You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2018/11/21 19:50:52 UTC

[pulsar] branch master updated: [state] use closeAsync to close state storage client (#3028)

This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 4e10472  [state] use closeAsync to close state storage client (#3028)
4e10472 is described below

commit 4e10472999b8545f90232f21ab5764fe33f301af
Author: Sijie Guo <gu...@gmail.com>
AuthorDate: Wed Nov 21 11:50:48 2018 -0800

    [state] use closeAsync to close state storage client (#3028)
---
 .../org/apache/pulsar/functions/instance/JavaInstanceRunnable.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
index 70ed588..fd3cf95 100644
--- a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
+++ b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
@@ -448,7 +448,11 @@ public class JavaInstanceRunnable implements AutoCloseable, Runnable {
             stateTable = null;
         }
         if (null != storageClient) {
-            storageClient.close();
+            storageClient.closeAsync()
+                .exceptionally(cause -> {
+                    log.warn("Failed to close state storage client", cause);
+                    return null;
+                });
         }
 
         // once the thread quits, clean up the instance