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

Revert "Fix task cancellation propagation to subtasks when using sync… #453

Closed
wants to merge 1 commit into from

Conversation

carltongibson
Copy link
Member

… middleware (#435)"

This reverts commit 0503c2c.

Fixes #452.

I don't know if there's a better way, but reviewing #435 it seemed likely there might be an issue, so it might be worth reverting and then taking a bit more time there.

@ttys0dev do you have any thoughts?

@carltongibson
Copy link
Member Author

@felixxm This fixed the intermittent Django failures for me. Do you want to give it a run to confirm? Thanks.

@felixxm
Copy link
Member

felixxm commented Mar 21, 2024

TBH, I was not able to reproduce it locally 😅

@ttys0dev
Copy link
Contributor

@ttys0dev do you have any thoughts?

Well reverting would reintroduce the original bug which prevented task cancellation from working correctly so probably reverting isn't the best option here.

I don't know if there's a better way, but reviewing #435 it seemed likely there might be an issue, so it might be worth reverting and then taking a bit more time there.

I think the django test may have been relying on the previous incorrect task cancellation exception propagation, so the test itself might need fixing.

@carltongibson
Copy link
Member Author

@ttys0dev I'd be grateful if you could take a look.

The output sent when the test fails shows that the main process request task isn't being correctly cancelled with this change in place.

(The timeout is for the application communicator in the test, not the app itself. The communicator gets the timeout because the app didn't return a response, because the http.disconnect was processed.)

@carltongibson
Copy link
Member Author

Important to note, the original bug only affects cases where shield is being used, which is quite niche, compared to unknown scope of the issue with this patch in place.

Copy link
Member

@andrewgodwin andrewgodwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unfortunate we have to back this one out but yes, seems like we need a way to replicate the Django test conditions in a test here.

@carltongibson
Copy link
Member Author

@andrewgodwin @ttys0dev is looking now, so I suggest we hold until tomorrow. Hopefully we can work out the issue.

If we don't have progress I can roll a 3.8.1, and we can re-add this again more leisurely.

@andrewgodwin
Copy link
Member

Sounds like a good plan to me. This sort of thing always happens when we do fixes to the deep internals :)

@ttys0dev
Copy link
Contributor

Think I have a proper fix for this in #455.

@carltongibson
Copy link
Member Author

Closing in favour of #455.

@carltongibson carltongibson deleted the revert-0503c2c branch March 22, 2024 14:25
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.

Regression in v3.8.0
4 participants