-
Notifications
You must be signed in to change notification settings - Fork 19
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
Upgrade to Jesque 1.3.0 #24
Comments
I have been wondering if there is a way to make all of the job classes Runnable with Groovy metaprogramming. It seemed like it might be possible to do and would be attractive because it would be backward compatible. So far, unfortunately, I have been unsuccessful. I haven't been able to get something to work that can be passed into WorkerImpl's constructor and will also have Runnable.class.isAssignableFrom(jobType) return true. Have you had a chance to look into this issue at all yet? |
Sorry, I had some time off, and then took some time to get back into things. I'll be looking at this now. |
I think we just need to change the upstream Jesque project to allow the subclass to validate the jobType (gresrun/jesque#29). After that's approved, I'll release a version of grails-jesque. Thanks for the research and attempts at changing, it made tracking down the issue a lot easier. |
I've published a 0.6.0-SNAPSHOT with jesque 1.3.1. I plan on publising a final 0.6.0 after we deploy in production, and potentially doing something for issue #23, hopefully in the next few days. |
Thanks for getting this done. I submitted a pull request to get some new features into this plugin based on improvements in Jesque 1.3.0. |
I've merged that pull request and published it as 0.6.1 |
I would love to modify the Grails Jesque plugin to expose some new features in Jesque 1.3.0. I attempted to upgrade the plugin myself, but an exception was thrown when the only change I made was upgrading the Jesque library.
Problem
I changed the version of Jesque in BuildConfig from 1.2.0 to 1.3.0.
Then I tried to run my Grails app that uses the Jesque plugin, and I got this exception:
I think I have diagnosed the problem, but I don't know what the fix should be.
Diagnosis
The key changes appears to be WorkerImpl in v 1.3.0 now calls addJobType, which it didn't do before. This ends up calling GrailsWorkerImpl.addJobType, which attempts to modify an unmodifiable map, which throws the exception.
Details:
Has GrailsWorkerImpl.addJobType just not been getting called? It doesn't seem like this would have worked at any time in the past two years or so, which is as far back as I looked in the history for WorkerImpl. This map has been unmodifiable for a long time and the member variable has been private since the first commit.
Workaround
I did figure out a kind of ugly workaround.
This did work. It has the added ugliness of worthless Runnable implementations on all of the jobs, but it seemed to work fine with Jesque 1.3.0.
Better Fix?
I am guessing you will have a more elegant, permanent fix for this.
If you can suggest something else to try, I will do it. Assuming it works, I can send a pull request to you with the upgrades.
The text was updated successfully, but these errors were encountered: