Fixes #36533 by waiting for the socket to actually close on the Python side.
A diff to reproduce (with a minimal fix commented out) is in the issue thread.
The fix here rhymes on the minimal fix.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline and AI policy for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | ViniciusCestarii |
If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
tACK fa9a9657506dc742e657b2a288baed84873304f1
Verified with the repro diff that this prevents the intermitent failure