Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NATS JetStream support #2257

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

Saphri
Copy link

@Saphri Saphri commented Nov 18, 2024

Adding support for using NATS JetSteam key-value stores as lock backend

@lukas-krecan
Copy link
Owner

Thanks a lot, I will look at it soon

@lukas-krecan
Copy link
Owner

lukas-krecan commented Nov 18, 2024

Hi, thanks again. It seems to me, that there is another limitation, lockAtLeastFor/Until actually does not work, if the task takes shorter than lockAtLeastFor, the lock is held for lockAtMostFor, do I get it right? If that's so, let's log a warning if lockAtleast for is nonzero and mention it in the documentation. Any idea when NATS 2.11 should be released?

@Saphri
Copy link
Author

Saphri commented Nov 19, 2024

Yes you are correct.. I will update the documentation and add the warning

I did start on putting data into the key, but then started to worry about race conditions if I had to first read and then act on that. Here we dont use the atLeastFor feature at all, and only use this for ensuring some physical devices only receives commands from one process at a time

NATS 2.11 should be close,.. still claims to be coming in 2024

@lukas-krecan
Copy link
Owner

Thanks a lot, how urgently do you need it? Does it make sense to wait few weeks for 2.11?

@Saphri
Copy link
Author

Saphri commented Nov 19, 2024

I'm not confident that NATS will release 2.11 this year... not even an RC/Beta have been seen

Internally we have a lib with this code that we just import, so we have no urgent need. We just wanted to give back 😸

@lukas-krecan
Copy link
Owner

Hi, I appreciate it. I prefer to keep the PR open and wait for the 2.11. The reason is that if they indeed deliver more fine-grained TTLs, the move from the current solution to the new one would be backwards incompatible, so I would have to keep both versions for some time. Thanks for understanding. Can you please ping me if there are any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants