When a user CNTRL-C's a Python application, that signal is forwarded to all child processes. This works well, until it's time to tear down the queue between processes, when Python starts logging error messages about broken pipes. We want to suppress these error messages, but also allow the TaskPool to be re-used.
<rdar://problem/78472148>
Created attachment 429689 [details] Patch
Created attachment 429765 [details] Patch
Comment on attachment 429765 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429765&action=review > Tools/ChangeLog:13 > + (TaskPool.__init__): Defer worker and queue construction to context manager. Could you tell me more about this deferral? > Tools/Scripts/libraries/webkitcorepy/webkitcorepy/task_pool.py:-335 > - from mock import patch Could you tell me more about this change? I think this was for making unit tests happy?
Comment on attachment 429765 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429765&action=review >> Tools/ChangeLog:13 >> + (TaskPool.__init__): Defer worker and queue construction to context manager. > > Could you tell me more about this deferral? The point of this deferral is so that we never have unusable but instantiated queues. Basically, if children processes receive a CNTRL-C, the queues in the parent process will end up with broken pipes. We then need to close, clean up and re-construct those queues. Given that the queues and workers aren't really valid until we start them in the first place, it seemed best to tie both the queue and the workers directly to the context manager. >> Tools/Scripts/libraries/webkitcorepy/webkitcorepy/task_pool.py:-335 >> - from mock import patch > > Could you tell me more about this change? I think this was for making unit tests happy? Oh, oops, yeah, I should put that back in. My IDE said it was unused, and I wasn't paying attention
Created attachment 429945 [details] Patch
Comment on attachment 429945 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429945&action=review r=me > Tools/ChangeLog:13 > + (TaskPool.__init__): Defer worker and queue construction to context manager. Might be useful to mention why we want to do this.
Created attachment 429969 [details] Patch for landing
Committed r278187 (238230@main): <https://commits.webkit.org/238230@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 429969 [details].