You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/05/21 15:27:09 UTC

[GitHub] [pulsar] cckellogg commented on a change in pull request #7010: Fix null pointer when getting function instance metrics.

cckellogg commented on a change in pull request #7010:
URL: https://github.com/apache/pulsar/pull/7010#discussion_r428723696



##########
File path: pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
##########
@@ -801,4 +810,12 @@ public void setupOutput(ContextImpl contextImpl) throws Exception {
             Thread.currentThread().setContextClassLoader(this.instanceClassLoader);
         }
     }
+
+    public String getStatsAsString() throws IOException {
+        if (stats != null) {

Review comment:
       We should synchronize this method as well?  
   
   Also line 241 (run() method) accesses the stats variable and the close() method does too. Difference threads access these methods and change the stats variable. It's the same for other variables in this class. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org