C-Otto/lnd-manageJ

Bug: middleware doesn't reconnect after lnd restart

C-Otto opened this issue · 2 comments

Describe the bug
If I start lnd while lnd-manageJ is running, the liquidity information isn't updated. It looks like the middleware does NOT reconnect/re-register to/with lnd.

Can't reproduce. The middleware is registered a few seconds after lnd reboots. A new instance of RequestAndResponseStreamObserver is created. The (old, existing) singleton listeners are registered and called for new messages. This includes HTLC updates (HtlcAttemptListener), which causes the liqidity information to be updated.

ERROR io.grpc.internal.SerializingExecutor: Exception while executing runnable io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed@36e0b866java.lang.NullPointerException: null
at java.base/java.util.Objects.requireNonNull(Objects.java:208) ~[na:na]
at de.cotto.lndmanagej.grpc.middleware.RequestAndResponseStreamObserver.onError(RequestAndResponseStreamObserver.java:63) ~[grpc-adapter-plain.jar!/:na]
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:478) ~[grpc-stub-1.45.1.jar!/:1.45.1]
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:562) ~[grpc-core-1.45.1.jar!/:1.45.1]
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70) ~[grpc-core-1.45.1.jar!/:1.45.1]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:743) ~[grpc-core-1.45.1.jar!/:1.45.1]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:722) ~[grpc-core-1.45.1.jar!/:1.45.1]
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.45.1.jar!/:1.45.1]
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) ~[grpc-core-1.45.1.jar!/:1.45.1]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]