node-red-context-redis icon indicating copy to clipboard operation
node-red-context-redis copied to clipboard

Redis db connection for global state is lost when node-red canvas is refreshed

Open cmerchant opened this issue 6 years ago • 3 comments

We are trying to make use of the plugin to allow global context to be saved and retrieved from our Redis db. It works fine until there is a browser refresh of the node-red canvas. After that, the state can no longer be retrieved from the database. Our only work around to force a reconnection is to restart the node-red container and reestablish the browser session.

cmerchant avatar Nov 07 '19 17:11 cmerchant

That is strange - the context storage plugin should be completely independent of what the editor is doing.

It's also a good reminder that none of the code has actually been reviewed, merged or supported by the project yet.

knolleary avatar Nov 07 '19 17:11 knolleary

We think we know the issue and have a repro. If we lose connection to redis for any reason, the plugin does not have a retry strategy defined. It is explicitly set to undefined in the plugin code (line 179 index.js). Is there any reason for this setting? We forked the repository and commented out this code and no longer see the issue. Once networking is restored the default retry strategy in the redis client reestablishes the connection to the db.

cmerchant avatar Nov 13 '19 20:11 cmerchant

That's a good question to add as a review comment on #1. As I said, I haven't reviewed this code yet, so I'm grateful for any comments you have to help.

knolleary avatar Nov 13 '19 21:11 knolleary