Skip to content

Commit

Permalink
[Functions] Prevent NPE while stopping a non started Pulsar LogAppend…
Browse files Browse the repository at this point in the history
…er (apache#12643)
  • Loading branch information
eolivelli authored Nov 5, 2021
1 parent 176f75a commit f65f272
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,18 @@ public void start() {
.property("function", fqn)
.create();
} catch (Exception e) {
throw new RuntimeException("Error starting LogTopic Producer", e);
throw new RuntimeException("Error starting LogTopic Producer for function " + fqn, e);
}
this.state = State.STARTED;
}

@Override
public void stop() {
this.state = State.STOPPING;
producer.closeAsync();
producer = null;
if (producer != null) {
producer.closeAsync();
producer = null;
}
this.state = State.STOPPED;
}

Expand Down

0 comments on commit f65f272

Please sign in to comment.