jaraco / irc

Full-featured Python IRC library for Python.
MIT License
392 stars 86 forks source link

Sleep while holding a mutex #35

Closed jaraco closed 8 years ago

jaraco commented 8 years ago

IRC.process_once sleeps while holding a mutex, which can cause the library to lock up for long periods of time (sometimes hours). This issue was found in irker's fork.


jaraco commented 8 years ago

Remove mutex from process_once. Fixes #35

→ <<cset 75354b76bbcb>>


Original comment by: Jason R. Coombs

jaraco commented 8 years ago

@ai0867 Can you review the changes and test with the latest tip? I've removed the mutex. I believe removing the mutex was the right thing to do and instead only protect the read of self.connections (via the new self.sockets property), based on the comment of the purpose of the mutex. However, I can't be sure, so please provide any feedback you can before I release it. Thanks.


Original comment by: Jason R. Coombs

jaraco commented 8 years ago

It looks correct enough, but I can't really be sure either. There might be a race there with sockets dying before you process their data, though it looks like you catch that. Irker dropped the use of this library a while back, so I can't help with testing it.


Original comment by: ai0867