-
Notifications
You must be signed in to change notification settings - Fork 32
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
Thread safety #6
Comments
Hi Rob I have it working on two similar setups but way older django versions. But I agree, the If the solution isn't obvious, let me know and I'll have a look too. And thx for improving this proejct! Cheers |
Your welcome Rune. :) I will take another proper look at this tonight and see if I can find a neat and tidy, backwards compatible solution. :) Many thanks, |
Hmmm - Am getting similar errors. I think a register approach would be better, no? It's kind of unicorny. |
Hi Rune, I shall try and take some time this weekend to get a pull request setup for you. Many thanks, |
I know about not having time. I could use 72 hours a day easily :) If you do have time that would be awesome! I've been relearning why I did the hack, and it's actually pretty clever. But I reckon the correct solution is to get the form the same way that modeladmin does it? Or what's your approach? |
Hi Rune, A 72 hour day sounds good! :) I think we should start a pertition! No worries, I will try and get some time at the weekend and raise a pull request. My solution utilizes a registration based approach which should be considerably less error prone when running in a multi-thread environment. I would need to look to see what the django model admin does to return the form but a neater solution may possibly reveal itself by checking what django does first. I shall be sure to check it out before I raise a request with my registration based approach. Cheers, |
Ping @runekaagaard @robcharlwood The fix could be easily done using Redis to store the hashes. As I will need it in the coming weeks in a production project, I will implement it. regards, |
Ping @Karmak23 @robcharlwood
|
If you in your flexselect widget sets a ``unique_name`` property it bypasses the faulty mechanism of magically creating a safe hashed name. Example: MyFlexSelectWidget(FlexSelectWidget): unique_name = 'my_flexselect_widget' # A name that is allowed to be shown in the HTML. ... etc.
I've just added a fix, if you want to test it, go right ahead :) |
Check the commit message for how to do it: 2d6325b |
Hello,
This package does not currently appear to be thread safe. When running this package under gunicorn with multiple workers (I used 4 for my sample), flex select fails with the below traceback. For your reference my setup was django 1.5.5 on Python 2.7.3 with nginx proxying to gunicorn 18.0.
I think this is due to the way that the
FlexWidget
s are being stored in the module/memory. I am currently working to find a fix to the issue. I will raise a pull request when I have something that works.Many thanks,
Rob
The text was updated successfully, but these errors were encountered: