Skip to content

Commit

Permalink
another fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fqaiser94 committed Apr 9, 2024
1 parent 13f015e commit 48b0595
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private Map<TopicPartition, Long> committedOffsets(AdminFactory adminFactory, St
}

private void throwExceptionIfCoordinatorIsTerminated() {
if (isLeader && coordinatorThread.isTerminated()) {
if (isLeader && coordinatorThread != null && coordinatorThread.isTerminated()) {
throw new IllegalStateException("Coordinator unexpectedly terminated");
}
}
Expand Down Expand Up @@ -245,7 +245,7 @@ private <T> void close(T closeable) {
@Override
public void close() throws IOException {
close(commitRequestListener);
if (isLeader) {
if (isLeader && coordinatorThread != null) {
coordinatorThread.terminate();
}
close(producer);
Expand Down

0 comments on commit 48b0595

Please sign in to comment.