)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"94662c228ee5da43b0d4b6c6dfffed36a65adc17","unresolved":false,"context_lines":[{"line_number":18,"context_line":"This fix will poll existing processes in the namespace without making"},{"line_number":19,"context_line":"use of the wait_until_true loop. Instead, it will check elapsed time"},{"line_number":20,"context_line":"and raise the exception if timeout is exceeded."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: Ie233261e4be36eecaf6ec6d0532f0f5e2e996cd2"},{"line_number":23,"context_line":"Closes-Bug: #1654287"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7a3c09a3_8ee0ec97","line":21,"updated":"2017-01-17 15:51:42.000000000","message":"Maybe worth mentioning the patch also removes the added debug logs that help to find the root cause.","commit_id":"da13176469a78926ca910bdda33f8c5834da92a6"}],"neutron/cmd/netns_cleanup.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"94662c228ee5da43b0d4b6c6dfffed36a65adc17","unresolved":false,"context_lines":[{"line_number":168,"context_line":"    # in subsequent calls to utils.execute grabbing always the output of the"},{"line_number":169,"context_line":"    # previous command"},{"line_number":170,"context_line":"    start \u003d end \u003d time.time()"},{"line_number":171,"context_line":"    while (end - start) \u003c SIGTERM_WAITTIME:"},{"line_number":172,"context_line":"        if not find_listen_pids_namespace(namespace):"},{"line_number":173,"context_line":"            return"},{"line_number":174,"context_line":"        time.sleep(1)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a3c09a3_ae7a08ef","line":171,"range":{"start_line":171,"start_character":10,"end_line":171,"end_character":11},"updated":"2017-01-17 15:51:42.000000000","message":"Nit: Parenthesis are not needed, arithmetic operators have precedence over comparison operators.","commit_id":"da13176469a78926ca910bdda33f8c5834da92a6"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0252ad4fc60725eb4aa8768d0ef6f0aab627a064","unresolved":false,"context_lines":[{"line_number":168,"context_line":"    # in subsequent calls to utils.execute grabbing always the output of the"},{"line_number":169,"context_line":"    # previous command"},{"line_number":170,"context_line":"    start \u003d end \u003d time.time()"},{"line_number":171,"context_line":"    while end - start \u003c SIGTERM_WAITTIME:"},{"line_number":172,"context_line":"        if not find_listen_pids_namespace(namespace):"},{"line_number":173,"context_line":"            return"},{"line_number":174,"context_line":"        time.sleep(1)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_618e472f","line":171,"range":{"start_line":171,"start_character":24,"end_line":171,"end_character":40},"updated":"2017-01-18 08:45:00.000000000","message":"this should be timeout","commit_id":"d3f3ae490576c6e663bd27c7a18f647510e7b121"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"6a074178c3487f81712005f73cbbcfa9050b7ee8","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    then a PidsInNamespaceException will be thrown."},{"line_number":163,"context_line":"    \"\"\""},{"line_number":164,"context_line":"    # NOTE(dalvarez): This function can block forever if"},{"line_number":165,"context_line":"    # find_listen_pids_in_namespace never returns which is really unlikely. We"},{"line_number":166,"context_line":"    # can\u0027t use wait_until_true because we might get interrupted by eventlet"},{"line_number":167,"context_line":"    # Timeout during our I/O with rootwrap daemon and that will lead to errors"},{"line_number":168,"context_line":"    # in subsequent calls to utils.execute grabbing always the output of the"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a3c09a3_211fd15b","line":165,"range":{"start_line":165,"start_character":6,"end_line":165,"end_character":35},"updated":"2017-01-18 12:40:58.000000000","message":"So the only case in which this blocks is if netstat doesn\u0027t return, right? Well, we can check that :)\n\nUnder posix (non-windows), popen.communicate() uses either poll() or select(), and eventlet makes these functions \"safe\" to use in a multithreaded environment (so if you have 2 greenthreads when one is running select()/poll() and it doesn\u0027t return, the second function will still get run-time).\n\nThis, in addition to greenthread.kill [1] will let you do the following (pseudo-code):\n\n def wait_until_no_listen_pids_namespace():\n     spawn new greenthread -\u003e my_greenthread\n     run find_listen_pids_in_namespace() in my_greenthread\n     while end - start:\n         # ...\n     my_greenthread.kill() # timeout occurred and greenthread didn\u0027t finish yet - kill it.\n\n\n[1]: http://eventlet.net/doc/modules/greenthread.html#eventlet.greenthread.kill","commit_id":"3f9f740d81b51be5e563069c720366fa90ade9ee"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"93e0f0b4d8599a9eaf9ac7922de6508d5d0af41b","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    then a PidsInNamespaceException will be thrown."},{"line_number":163,"context_line":"    \"\"\""},{"line_number":164,"context_line":"    # NOTE(dalvarez): This function can block forever if"},{"line_number":165,"context_line":"    # find_listen_pids_in_namespace never returns which is really unlikely. We"},{"line_number":166,"context_line":"    # can\u0027t use wait_until_true because we might get interrupted by eventlet"},{"line_number":167,"context_line":"    # Timeout during our I/O with rootwrap daemon and that will lead to errors"},{"line_number":168,"context_line":"    # in subsequent calls to utils.execute grabbing always the output of the"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a3c09a3_643d67c3","line":165,"range":{"start_line":165,"start_character":6,"end_line":165,"end_character":35},"in_reply_to":"7a3c09a3_211fd15b","updated":"2017-01-18 12:58:12.000000000","message":"I don\u0027t really know the internals but I think the issue is that communicate() in eventlet yields and other thread raises timeout, which means after select() returns a socket that has data, the read() is not called due to exception interruption. Hence data are left in the socket and are read on the next use of rootwrap-daemon - rwd(TM).","commit_id":"3f9f740d81b51be5e563069c720366fa90ade9ee"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"8ed011334a27bf0df5991c93d9f0aaa937af89ee","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    then a PidsInNamespaceException will be thrown."},{"line_number":163,"context_line":"    \"\"\""},{"line_number":164,"context_line":"    # NOTE(dalvarez): This function can block forever if"},{"line_number":165,"context_line":"    # find_listen_pids_in_namespace never returns which is really unlikely. We"},{"line_number":166,"context_line":"    # can\u0027t use wait_until_true because we might get interrupted by eventlet"},{"line_number":167,"context_line":"    # Timeout during our I/O with rootwrap daemon and that will lead to errors"},{"line_number":168,"context_line":"    # in subsequent calls to utils.execute grabbing always the output of the"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a3c09a3_177bf77b","line":165,"range":{"start_line":165,"start_character":6,"end_line":165,"end_character":35},"in_reply_to":"7a3c09a3_643d67c3","updated":"2017-01-18 13:18:47.000000000","message":"I agree with Jakub. Your solution would be the same as the one without this patch and we won\u0027t get the bug fixed. Plus, this is a workaround until we can get oslo.rootwrap fixed by, for example, flushing the UNIX domain socket before any other command is executed","commit_id":"3f9f740d81b51be5e563069c720366fa90ade9ee"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"6a074178c3487f81712005f73cbbcfa9050b7ee8","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    # can\u0027t use wait_until_true because we might get interrupted by eventlet"},{"line_number":167,"context_line":"    # Timeout during our I/O with rootwrap daemon and that will lead to errors"},{"line_number":168,"context_line":"    # in subsequent calls to utils.execute grabbing always the output of the"},{"line_number":169,"context_line":"    # previous command"},{"line_number":170,"context_line":"    start \u003d end \u003d time.time()"},{"line_number":171,"context_line":"    while end - start \u003c timeout:"},{"line_number":172,"context_line":"        if not find_listen_pids_namespace(namespace):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a3c09a3_144db899","line":169,"updated":"2017-01-18 12:40:58.000000000","message":"Super-super-super-nit: please end the paragraph with a \u0027.\u0027 to indicate end of sentence :)","commit_id":"3f9f740d81b51be5e563069c720366fa90ade9ee"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"8ed011334a27bf0df5991c93d9f0aaa937af89ee","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    # can\u0027t use wait_until_true because we might get interrupted by eventlet"},{"line_number":167,"context_line":"    # Timeout during our I/O with rootwrap daemon and that will lead to errors"},{"line_number":168,"context_line":"    # in subsequent calls to utils.execute grabbing always the output of the"},{"line_number":169,"context_line":"    # previous command"},{"line_number":170,"context_line":"    start \u003d end \u003d time.time()"},{"line_number":171,"context_line":"    while end - start \u003c timeout:"},{"line_number":172,"context_line":"        if not find_listen_pids_namespace(namespace):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a3c09a3_97e60742","line":169,"in_reply_to":"7a3c09a3_013735ff","updated":"2017-01-18 13:18:47.000000000","message":"If we need another respin I\u0027ll add the requested \".\" from the deepest of my heart :)","commit_id":"3f9f740d81b51be5e563069c720366fa90ade9ee"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"93e0f0b4d8599a9eaf9ac7922de6508d5d0af41b","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    # can\u0027t use wait_until_true because we might get interrupted by eventlet"},{"line_number":167,"context_line":"    # Timeout during our I/O with rootwrap daemon and that will lead to errors"},{"line_number":168,"context_line":"    # in subsequent calls to utils.execute grabbing always the output of the"},{"line_number":169,"context_line":"    # previous command"},{"line_number":170,"context_line":"    start \u003d end \u003d time.time()"},{"line_number":171,"context_line":"    while end - start \u003c timeout:"},{"line_number":172,"context_line":"        if not find_listen_pids_namespace(namespace):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a3c09a3_013735ff","line":169,"in_reply_to":"7a3c09a3_144db899","updated":"2017-01-18 12:58:12.000000000","message":"lol","commit_id":"3f9f740d81b51be5e563069c720366fa90ade9ee"}]}
