Skip to content

NPE in WorkflowListenerManagerImpl at line 48 on event type CONNECTION_RECONNECTED with data = null #51

@beloyar777

Description

@beloyar777

Getting the following NPE while executing your example:

2023-09-12 09:40:32,831 ERROR org.apache.curator.framework.recipes.cache.PathChildrenCache [Curator-PathChildrenCache-0] -
java.lang.NullPointerException: Cannot invoke "org.apache.curator.framework.recipes.cache.ChildData.getPath()" because the return value of "org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent.getData()" is null
                at com.nirmata.workflow.details.WorkflowListenerManagerImpl.lambda$start$0(WorkflowListenerManagerImpl.java:48) ~[nirmata-workflow-0.9.7.jar:?]
                at org.apache.curator.framework.recipes.cache.PathChildrenCache.lambda$callListeners$1(PathChildrenCache.java:535) ~[curator-recipes-5.5.0.jar:5.5.0]
                at org.apache.curator.framework.listen.MappingListenerManager.lambda$forEach$0(MappingListenerManager.java:93) ~[curator-framework-5.5.0.jar:5.5.0]
                at org.apache.curator.framework.listen.MappingListenerManager.forEach(MappingListenerManager.java:90) ~[curator-framework-5.5.0.jar:5.5.0]
                at org.apache.curator.framework.listen.StandardListenerManager.forEach(StandardListenerManager.java:90) ~[curator-framework-5.5.0.jar:5.5.0]
                at org.apache.curator.framework.recipes.cache.PathChildrenCache.callListeners(PathChildrenCache.java:532) ~[curator-recipes-5.5.0.jar:5.5.0]
                at org.apache.curator.framework.recipes.cache.EventOperation.invoke(EventOperation.java:36) ~[curator-recipes-5.5.0.jar:5.5.0]
                at org.apache.curator.framework.recipes.cache.PathChildrenCache$8.run(PathChildrenCache.java:802) ~[curator-recipes-5.5.0.jar:5.5.0]
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
                at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
                at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
                at java.lang.Thread.run(Thread.java:833) ~[?:?]

At WorkflowListenerManagerImpl:48 on event = PathChildrenCacheEvent{type=CONNECTION_RECONNECTED, data=null}

    @Override
    public void start() {
        try {
            runsCache.getListenable().addListener((client, event) -> {
                RunId runId = new RunId(ZooKeeperConstants.getRunIdFromRunPath(event.getData().getPath())); //<-- NPE here
                if (event.getType() == PathChildrenCacheEvent.Type.CHILD_ADDED) {
                    postEvent(new WorkflowEvent(WorkflowEvent.EventType.RUN_STARTED, runId));
                } else if (event.getType() == PathChildrenCacheEvent.Type.CHILD_UPDATED) {
                    postEvent(new WorkflowEvent(WorkflowEvent.EventType.RUN_UPDATED, runId));
                }
            });

ZK server 3.6.4
ZK clients tested 3.6.4, 3.7.1, 3.8.2, 3.9.0
curator-recipes 5.2.0, 5.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions