This is an automated email from the ASF dual-hosted git repository. guozhang pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push: new e1c4079 MINOR: Improve exception messages when state stores cannot be accessed. (#4383) e1c4079 is described below commit e1c407973f5c4a7af6b80c1a9be92ab1635de665 Author: Ewen Cheslack-Postava <m...@ewencp.org> AuthorDate: Mon Jan 8 11:14:54 2018 -0800 MINOR: Improve exception messages when state stores cannot be accessed. (#4383) --- .../streams/state/internals/StreamThreadStateStoreProvider.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/streams/src/main/java/org/apache/kafka/streams/state/internals/StreamThreadStateStoreProvider.java b/streams/src/main/java/org/apache/kafka/streams/state/internals/StreamThreadStateStoreProvider.java index cb5a8f8..415c6a2 100644 --- a/streams/src/main/java/org/apache/kafka/streams/state/internals/StreamThreadStateStoreProvider.java +++ b/streams/src/main/java/org/apache/kafka/streams/state/internals/StreamThreadStateStoreProvider.java @@ -45,14 +45,16 @@ public class StreamThreadStateStoreProvider implements StateStoreProvider { return Collections.emptyList(); } if (!streamThread.isRunningAndNotRebalancing()) { - throw new InvalidStateStoreException("the state store, " + storeName + ", may have migrated to another instance."); + throw new InvalidStateStoreException("Cannot get state store " + storeName + " because the stream thread is " + + streamThread.state() + ", not RUNNING"); } final List<T> stores = new ArrayList<>(); for (Task streamTask : streamThread.tasks().values()) { final StateStore store = streamTask.getStore(storeName); if (store != null && queryableStoreType.accepts(store)) { if (!store.isOpen()) { - throw new InvalidStateStoreException("the state store, " + storeName + ", may have migrated to another instance."); + throw new InvalidStateStoreException("Cannot get state store " + storeName + " for task " + streamTask + + " because the store is not open. The state store may have migrated to another instances."); } stores.add((T) store); } -- To stop receiving notification emails like this one, please contact ['"commits@kafka.apache.org" <commits@kafka.apache.org>'].