-
-
Notifications
You must be signed in to change notification settings - Fork 800
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
Multiple concurrency issues #638
Comments
Ok, so I think the (second) problem is different now. Might not even be a concurrency issue. I have
I'm not excluding the fact that some of the clients that connect to me are doing some weird things, but still, we should not fall in this situation. |
Wow, so found it (I think). Nothing to do with a concurrency issue. So I think the PR submitted fixes the concurrency part. (actually maybe it's rather unsafe that you can do --> Opening a separate issue to discuss the data inconsistency we can end up in |
could that be related to https://code.djangoproject.com/ticket/29499 ? |
well it's not linked to an |
(cherry picked from commit 199e818)
(cherry picked from commit 199e818)
I don't think it's is fixed. I am still getting it in version 1.2.0
|
Any chance this will be fixed. Or at least any version that is kinda stable I can use that. |
See #663 |
@gbataille did you manage to find the issue? I am also having the same error Integrity error. Out of 288,000 requests, only 80 raised the error, so it is very hard to replicate. I am also having another error, which I believe may be related: This is even less frequent, about 5 requests raised this error out of 288,000 making it even harder to replicate. I have a feeling the issue arises due to our access/refresh application logic, but not entirely sure. I would have thought that if it were an issue with django-oauth, that the issue would be more widespread and django-oauth would have been updated recently. |
@jamesshaw49 since I raised these 2 PR and put them in my production, I have never had the issue again. Lookup my comments in #645 |
We are also suffering from these issues using 1.2.
Should we merge your PR into master as well? We can use 1.1 in the mean time, but I'm worried this will get forgotten about and lost for future releases. Edit: My apologies, looks like it did get merged back into master, but the 1.2 tag is before the cherry pick. Can we cut a new release to fix the issue for those not on 1.1? |
I'm indeed still on 1.1. Following your comment, I'll wait before moving to 1.2! scratch that, I'm actually still on my own fork. Not on Django 2 yet :( so I have not tried to update to a version of |
Is it possibly solved by #810? |
This appears to still be an issue in the current version. Anything I can do to help get this resolved? |
@daveisfera Please document in detail how you are able to reproduce this error with the latest code release and master branch, preferably with code that someone else can run. And submit a PR if you are able to resolve it. Given the history of this ticket, it looks like a hard one to clearly understand and seems to be limited to a small number of people experiencing it. Thanks. |
I've been working on making a reproducer for this, but I haven't had any luck so far. I thought it was from multiple requests made at the same time, but I haven't been able to get my tests to fail with all of the variations that I've tried. Any ideas on what I can try to make it happen? |
Hi all,
Issue
So for 2 years that I have been using django-oauth-toolkit, I have been plagued with concurrency issues of the form
originally from
but after moving to version 1.1.2, it's
The thing is that (for me), 1.1.2 has also brought a new kind of issues
from
I finally got to really look into them.
Problem
For me, those are concurrency issues that are due to the fact that we get the refresh_token from the db early in the process and that we try to use it later (to create a new access token for example).
I have drawn the process in a small diagram (source here)
With the problem being in between the 2 red steps.
We must not have 2 processes going to this rightmost branch with the same refresh token.
To Reproduce
You can try and force some concurrency like so.
https://gist.github.com/gbataille/099a9eb4989c4277e9ce3312c8014391
Using it locally, I can make it fail in one of the 2 cases above quite often.
Fix
I think I have a fix. At least the logic seems sound, and I can't reproduce the issue anymore after applying it.
Submitting the PR
The key is to add the green step
The text was updated successfully, but these errors were encountered: