[issue43939] Deadlock in logging

2021-04-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I'm kind of puzzled on that fact that context manager solves it. It "solves" the problem because of the happenstance rather than because of language guarantees. The current implementation of the with-statement in CPython is to generate a SETUP_WITH op

[issue43939] Deadlock in logging

2021-04-27 Thread DaRoee
DaRoee added the comment: Ha! Already gave them my analysis, and stopped using that package since. While I certainly think this is not the trivial, basic usage, and that the pattern used for the lock is common (and part of some PEP if I remember correctly), I'm kind of puzzled on that fact th

[issue43939] Deadlock in logging

2021-04-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: But also, please ask the "external package" that uses PyThreadState_SetAsyncExc to clear up its documentation and mentions the pitfalls. -- ___ Python tracker _

[issue43939] Deadlock in logging

2021-04-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: Feel free to submit a PR to use context managers, though I'm not sure it solves the problem in a guaranteed way. Nick, what is the official word wrt. interruptibility of context managers? -- nosy: +ncoghlan ___ Py

[issue43939] Deadlock in logging

2021-04-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: A few thoughts: * We normally say "all bets are off" when it comes to manipulating Python internals with ctypes. This issue is just one of many ways to wreak havoc. * The programming pattern of killing running threads at arbitrary points in their execut

[issue43939] Deadlock in logging

2021-04-25 Thread DaRoee
Change by DaRoee : -- nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue43939] Deadlock in logging

2021-04-25 Thread DaRoee
New submission from DaRoee : I've recently encountered a weird bug. To make a long story short, I’ve been using an external package to make sure my threads stop working in time, and appearently it’s been using ctypes.pythonapi.PyThreadState_SetAsyncExc. There is a slight chance, that this code