This is an automated email from the ASF dual-hosted git repository.
sijie 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 fe5cea3 Fix returned status code for get function state when state
does not exist (#8437)
fe5cea3 is described below
commit fe5cea38a43aa4b4703a1378da1a605380f2faf6
Author: Boyang Jerry Peng <[email protected]>
AuthorDate: Tue Nov 3 17:07:02 2020 -0800
Fix returned status code for get function state when state does not exist
(#8437)
* Fix returned status code for get function state when state does not exist
* improving logs
Co-authored-by: Jerry Peng <[email protected]>
---
.../org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java
b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java
index 1ec5076..29766e6 100644
---
a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java
+++
b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java
@@ -1084,8 +1084,8 @@ public abstract class ComponentImpl {
}
} catch (RestException e) {
throw e;
- } catch
(org.apache.bookkeeper.clients.exceptions.NamespaceNotFoundException e) {
- log.error("Error while getFunctionState request @ /{}/{}/{}/{}",
+ } catch
(org.apache.bookkeeper.clients.exceptions.NamespaceNotFoundException |
StreamNotFoundException e) {
+ log.debug("State not found while processing getFunctionState
request @ /{}/{}/{}/{}",
tenant, namespace, functionName, key, e);
throw new RestException(Status.NOT_FOUND, e.getMessage());
} catch (Exception e) {
@@ -1164,7 +1164,7 @@ public abstract class ComponentImpl {
try (Table<ByteBuf, ByteBuf> table =
result(storageClient.get().openTable(tableName))) {
result(table.put(Unpooled.wrappedBuffer(key.getBytes(UTF_8)),
value));
} catch
(org.apache.bookkeeper.clients.exceptions.NamespaceNotFoundException |
org.apache.bookkeeper.clients.exceptions.StreamNotFoundException e) {
- log.error("Error while putFunctionState request @ /{}/{}/{}/{}",
+ log.debug("State not found while processing putFunctionState
request @ /{}/{}/{}/{}",
tenant, namespace, functionName, key, e);
throw new RestException(Status.NOT_FOUND, e.getMessage());
} catch (Exception e) {