bloxbean / yaci

A Cardano Mini Protocols implementation in Java
MIT License
22 stars 3 forks source link

sessionListeners are lost during reconnect #2

Open sacrelege opened 1 year ago

sacrelege commented 1 year ago

NodeClient.class line 138 resets session before creating a new one. As far as I can tell, this means all prev. set listeners are lost and not restored upon reconnect.

satran004 commented 1 year ago

If it's about SessionListener, start method is called again inside disconnect(). And in L69, the existing sessionListener is added to the new session. But agent listeners (which are application specific) are added to individual agents.

Fyi, please check BlockSync / BlockRangeSync high level apis if your use case is specific to block synchronization or block fetch for a range.

sacrelege commented 1 year ago

Its was about LocalClientProvider.addTxSubmissionListener(..) I think any set txSubmission listeners are lost upoin reconnect.

I'm using socat to connect to a remote node and experiencing reconnects after a while and it seems, I don't get any responses after the reconnect. but it also think tx submission doesn't work at all after the reconnect.. I guess have some bigger issues I have to investigate first.

satran004 commented 1 year ago

@sacrelege Thanks. That’s an agent listener. Ideally client should auto recover. Let me try to reproduce and find the root cause.