)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a304bc175503f33f58a447a69a1da7dd2b09f93","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"04eaa2d7_92087f1b","updated":"2023-06-12 19:28:15.000000000","message":"FWIW, this all came out of some weird behaviors I was seeing locally with the new tests in https://review.opendev.org/c/openstack/swift/+/789035:\n\n- running just the new test, it\u0027d pass;\n- running all of `test/unit`, everything would pass; but\n- running all tests in just `test/unit/common/test_wsgi.py`, the new test would fail!\n\nFinally tracked it down to some watchdog threads outliving their servers and calling `time.time()` while the new test was mocking it out and expecting to know all callers.","commit_id":"df6bc090cb7a18fd878a75f71edb749b9c66832c"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4d124c841b92369ff1393a265481c1223d2cf267","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"9462a1ea_81c56d03","updated":"2023-06-12 14:48:42.000000000","message":"seems totally reasonable on the surface\n\nbut for me, the guard around the \"private\" _final_pipeline_app interface raises a question about the reliability of the watchdog attribute and the cleanup behavior.","commit_id":"df6bc090cb7a18fd878a75f71edb749b9c66832c"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"6adc604e9e79fe517484540c461061fd4a23d9e7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"222e6384_e010c6de","updated":"2023-09-07 16:38:42.000000000","message":"OK, I guess trying to do this in `__del__` won\u0027t work out well 😕\n\nIt\u0027s frustrating, though, since we create a fair number of proxy server `Application`s _not_ via `run_server`... and they\u0027d all leave these dangling greenthreads...\n\nI\u0027ll try splitting these out, and pick up a few other places to explicitly kill the watchdog.","commit_id":"a7de2bf305e5fc6e627b8617c6ae18a4e413439b"}],"swift/common/wsgi.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4d124c841b92369ff1393a265481c1223d2cf267","unresolved":true,"context_lines":[{"line_number":448,"context_line":"    except socket.error as err:"},{"line_number":449,"context_line":"        if err.errno !\u003d errno.EINVAL:"},{"line_number":450,"context_line":"            raise"},{"line_number":451,"context_line":"    pool.waitall()"},{"line_number":452,"context_line":""},{"line_number":453,"context_line":""},{"line_number":454,"context_line":"class StrategyBase(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"05db6620_3edc081b","side":"PARENT","line":451,"updated":"2023-06-12 14:48:42.000000000","message":"moving this into a finally seems like a good idea!","commit_id":"4e38af269558bb7f8c3b38f3f1d448172d392d30"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a304bc175503f33f58a447a69a1da7dd2b09f93","unresolved":false,"context_lines":[{"line_number":448,"context_line":"    except socket.error as err:"},{"line_number":449,"context_line":"        if err.errno !\u003d errno.EINVAL:"},{"line_number":450,"context_line":"            raise"},{"line_number":451,"context_line":"    pool.waitall()"},{"line_number":452,"context_line":""},{"line_number":453,"context_line":""},{"line_number":454,"context_line":"class StrategyBase(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f28a9b8_026a13e9","side":"PARENT","line":451,"in_reply_to":"05db6620_3edc081b","updated":"2023-06-12 19:28:15.000000000","message":"I was a little torn about it -- I\u0027m fairly certain I had\n```\n    try:\n        wsgi.server(sock, app, wsgi_logger, **server_kwargs)\n    except socket.error as err:\n        if err.errno !\u003d errno.EINVAL:\n            raise\n        pool.waitall()\n    else:\n        pool.waitall()\n    finally:\n        if hasattr(app._pipeline_final_app, \u0027watchdog\u0027):\n            app._pipeline_final_app.watchdog.kill()\n```\nlocally at one point, but the double `waitall()` was a smell and I couldn\u0027t think of any good reason for us to _not_ want to wrap up still-running threads in the pool. And I **really** didn\u0027t want to nest `try`s.","commit_id":"4e38af269558bb7f8c3b38f3f1d448172d392d30"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4d124c841b92369ff1393a265481c1223d2cf267","unresolved":true,"context_lines":[{"line_number":450,"context_line":"            raise"},{"line_number":451,"context_line":"    finally:"},{"line_number":452,"context_line":"        pool.waitall()"},{"line_number":453,"context_line":"        if hasattr(app._pipeline_final_app, \u0027watchdog\u0027):"},{"line_number":454,"context_line":"            app._pipeline_final_app.watchdog.kill()"},{"line_number":455,"context_line":""},{"line_number":456,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"cb7d4def_84cbb317","line":453,"updated":"2023-06-12 14:48:42.000000000","message":"under what conditions is this going to be False?","commit_id":"df6bc090cb7a18fd878a75f71edb749b9c66832c"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4a304bc175503f33f58a447a69a1da7dd2b09f93","unresolved":false,"context_lines":[{"line_number":450,"context_line":"            raise"},{"line_number":451,"context_line":"    finally:"},{"line_number":452,"context_line":"        pool.waitall()"},{"line_number":453,"context_line":"        if hasattr(app._pipeline_final_app, \u0027watchdog\u0027):"},{"line_number":454,"context_line":"            app._pipeline_final_app.watchdog.kill()"},{"line_number":455,"context_line":""},{"line_number":456,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"6c80591a_8767f12b","line":453,"in_reply_to":"cb7d4def_84cbb317","updated":"2023-06-12 19:28:15.000000000","message":"Backend servers. Only proxies get watchdogs (today, anyway), but all WSGI servers go through `run_server`.","commit_id":"df6bc090cb7a18fd878a75f71edb749b9c66832c"}]}
