)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":20813,"name":"Sofia Enriquez","email":"lsofia.enriquez@gmail.com","username":"enriquetaso"},"change_message_id":"f72f9d4442bb2eaef92e029af2e87ac11e83871e","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Ensure image utils don\u0027t block greenthreads"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Whe doing image operations in Cinder we may start getting errors on"},{"line_number":10,"context_line":"RabbitMQ and DB connections, which result in the volume service"},{"line_number":11,"context_line":"appearing as down to the scheduler."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f79a3b5_d9ca8845","line":9,"updated":"2018-11-07 16:25:52.000000000","message":"I think this should be *when*.","commit_id":"7f13ea86b422c55a21d39e21f4fd82942733cb00"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"13eb3f931b4bcaafad9c2f8843dbe0822761e4db","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Ensure image utils don\u0027t block greenthreads"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Whe doing image operations in Cinder we may start getting errors on"},{"line_number":10,"context_line":"RabbitMQ and DB connections, which result in the volume service"},{"line_number":11,"context_line":"appearing as down to the scheduler."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f79a3b5_86ffbdaf","line":9,"in_reply_to":"3f79a3b5_d9ca8845","updated":"2018-11-08 09:54:13.000000000","message":"Thanks, will update it if I have to submit another patch.","commit_id":"7f13ea86b422c55a21d39e21f4fd82942733cb00"}],"cinder/image/image_utils.py":[{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"135915e7cb691a3d24de147964c4857d6e70c8cd","unresolved":false,"context_lines":[{"line_number":340,"context_line":"            reason\u003dmessage)"},{"line_number":341,"context_line":"    if verifier:"},{"line_number":342,"context_line":"        with fileutils.remove_path_on_error(path):"},{"line_number":343,"context_line":"            with open(path, \"rb\") as tem_file:"},{"line_number":344,"context_line":"                try:"},{"line_number":345,"context_line":"                    tpool.execute(_verify_image, tem_file, verifier)"},{"line_number":346,"context_line":"                    LOG.info(\u0027Image signature verification succeeded \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_111ea95d","line":343,"range":{"start_line":343,"start_character":12,"end_line":343,"end_character":21},"updated":"2018-11-06 22:25:01.000000000","message":"Hmm, do we have an issue that the code will exit the context handler here and close the file while the thread is still executing and using that file?\n\nProbably showing my ignorance here with Python threading execution, but the job failure makes me wonder if the device was still being accessed and if we need some kind of synchronization now.","commit_id":"7f13ea86b422c55a21d39e21f4fd82942733cb00"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"85889a2d7c9e24b55047044ebf737adf989bced9","unresolved":false,"context_lines":[{"line_number":340,"context_line":"            reason\u003dmessage)"},{"line_number":341,"context_line":"    if verifier:"},{"line_number":342,"context_line":"        with fileutils.remove_path_on_error(path):"},{"line_number":343,"context_line":"            with open(path, \"rb\") as tem_file:"},{"line_number":344,"context_line":"                try:"},{"line_number":345,"context_line":"                    tpool.execute(_verify_image, tem_file, verifier)"},{"line_number":346,"context_line":"                    LOG.info(\u0027Image signature verification succeeded \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_e24c7698","line":343,"range":{"start_line":343,"start_character":12,"end_line":343,"end_character":21},"in_reply_to":"3f79a3b5_111ea95d","updated":"2018-11-07 10:53:41.000000000","message":"It\u0027s a reasonable question, after all eventlet\u0027s threadpool interaction with greenthreads is quite complex.  It uses  the native thread pool, trampoline greenthread daemon, and queues, events, and sockets for the communication.\n\nHere\u0027s the overview of the native thread execution flow in eventlet:\n\nOn setup we create trampoline greenthreaded daemon, to handle the return of data from the native threads, and a socket to get signaled.\n\nWhen creating a native thread, we instantiate an event, which we put in the request queue together with the method to call and the arguments.  Then the greenthread waits for the event to complete.\n\nA native thread from the pool picks up the request to execute, and makes the call using those parameters.  The return value of the method or the exception is captured in the native thread and pushed into the response queue with the event instance we received on the request.  Finally the native thread sends a socket packet to signal the trampoline daemon, and finalizes it\u0027s execution.\n\nThe trampoline daemon gets the packet from the socket and gets the response from the queue, and uses the event that is in the response from the native thread to send the response (return value or exception) to the greenthread the made the initial call.\n\nThe original greenthread was waiting on the event instance, and now receives the response from the method call via the event.  Then it checks the response and either raises the exception or returns the value.\n\nFollowing the flow we can see that the native thread finished the execution when there is an uncaught exception, and we won\u0027t be doing any more I/O when this context manager catches any exception from the `_verify_image` method, because the native thread is no longer running.","commit_id":"7f13ea86b422c55a21d39e21f4fd82942733cb00"}]}
