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)

(cherry picked from commit f65f272)
(cherry picked from commit 932a34c)
  • Loading branch information
eolivelli authored and nicoloboschi committed Feb 28, 2022
1 parent 6262075 commit 896303c
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,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 896303c

Please sign in to comment.