kafka/checkstyle
cpettitt-confluent 7334222a71 KAFKA-8412: Fix nullpointer exception thrown on flushing before closing producers (#7207)
Prior to this change an NPE is raised when calling AssignedTasks.close
under the following conditions:

1. EOS is enabled
2. The task was in a suspended state

The cause for the NPE is that when a clean close is requested for a
StreamTask the StreamTask tries to commit. However, in the suspended
state there is no producer so ultimately an NPE is thrown for the
contained RecordCollector in flush.

The fix put forth in this commit is to have AssignedTasks call
closeSuspended when it knows the underlying StreamTask is suspended.

Note also that this test is quite involved. I could have just tested
that AssignedTasks calls closeSuspended when appropriate, but that is
testing, IMO, a detail of the implementation and doesn't actually verify
we reproduced the original problem as it was described. I feel much more
confident that we are reproducing the behavior - and we can test exactly
the conditions that lead to it - when testing across AssignedTasks and
StreamTask. I believe this is an additional support for the argument of
eventually consolidating the state split across classes.

Reviewers: Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-08-26 09:53:36 -07:00
..
.scalafmt.conf MINOR: Add Scalafmt to Streams Scala API (#4965) 2018-07-09 16:48:34 -07:00
checkstyle.xml KAFKA-7308: Fix rat and checkstyle config for Java 11 support (#5529) 2018-08-18 08:18:28 -07:00
import-control-core.xml MINOR: Update usage of deprecated API (#6146) 2019-01-29 11:15:43 -08:00
import-control.xml KAFKA-8412: Fix nullpointer exception thrown on flushing before closing producers (#7207) 2019-08-26 09:53:36 -07:00
java.header MINOR: improve license header check by providing head file instead of (prefix) header regex 2017-02-28 12:35:04 -08:00
suppressions.xml KAFKA-8345: KIP-455: Admin API changes (Part 2) (#7120) 2019-08-14 09:25:17 -07:00