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

RedisConnectionFactory support #47

Closed
ghost opened this issue Jan 18, 2018 · 10 comments
Closed

RedisConnectionFactory support #47

ghost opened this issue Jan 18, 2018 · 10 comments

Comments

@ghost
Copy link

ghost commented Jan 18, 2018

Hello there,

People who use SpringBoot and Redis have some problem with your Redis-provider. SpringBoot gives us some nice and easy configuration with RedisConnectionFactory. This CF uses the same RedisPool inside the implementation but that is private so no way to get it. Instead it gives us RedisConnection.

I created some nice implementation for your LockProvider interface. I can give it back to the community but I need some information about proper contributions here for that.

Thanks in advance.

@ghost ghost changed the title RedisFactoryLockProvider RedisConnectionFactory support Jan 18, 2018
@lukas-krecan
Copy link
Owner

Hi, thanks, do not hesitate to send a pull-request, contributions are welcome. (current Redis implementation has been contributed as well)

@clamey
Copy link
Contributor

clamey commented Jan 18, 2018

The current Redis implementation is Jedis specific and not reliant on anything from Spring. You can use Spring to configure it, but the JedisLockProvider implementation code just needs the Jedis jar to work.

Maybe for a Spring-based Redis provider, it should be a new sub-project (shedlock-provider-redis-connection)?

For giving back, I found it easiest to Fork the whole project, make my changes, and then do a Pull Request from my forked project back to lukas-krecan/ShedLock. It can then be reviewed and commented on.

@ghost
Copy link
Author

ghost commented Jan 18, 2018

Thank you guys, I will see what can I do. :)

@ghost
Copy link
Author

ghost commented Jan 19, 2018

Main file is uploaded already.
Test file and pom is coming soon.

@lukas-krecan
Copy link
Owner

Cool, let me know if you need any help.

@lukas-krecan
Copy link
Owner

Hi, just in case you do not have time to work on it, I will be more than happy to finish it.

@ghost
Copy link
Author

ghost commented Jan 31, 2018

I was way too busy sorry. Now I can do some work with this.
It might have one bug but I just can't trace it back. Most of the time it works like charm. Maybe it is my redis setup. Locks go wrong like once in a month.

@lukas-krecan
Copy link
Owner

OK. What sometimes happens is that locked tasks are shorter than the time-shift between machines in the cluster. So the task is executed multiple times (not in parallel but one after each other). Can be prevented by setting lockAtLeastFor. Maybe it's your case, maybe not. In any case, just let me know if you need any help.

@ghost
Copy link
Author

ghost commented Jan 31, 2018

lockAtLeastFor is set and most of the time it works. Sometimes redis doesn't expire or delete (? under investigate) the key for the lock, so basically it stucks in the db and causes no more job execution.

@ghost ghost mentioned this issue Jan 31, 2018
@ghost
Copy link
Author

ghost commented Feb 13, 2018

I think we can close it now.

@ghost ghost closed this as completed Feb 13, 2018
This issue was closed.
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

No branches or pull requests

2 participants