)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"97fffce9ed25be1366390778698d6100c94c9d22","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Alin Balutoiu \u003cabalutoiu@cloudbasesolutions.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-06-22 11:33:34 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add Windows support when using eventlet with monkey_patch"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently when eventlet monkey patch is used and the os module"},{"line_number":10,"context_line":"is monkey patched, os.fdopen can not be used on Windows."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"5f201791_a5fe2a68","line":7,"updated":"2017-06-28 07:27:57.000000000","message":"Not downvoting, however:\n\nI have some issues with the new design following this patch. I don\u0027t think\nwe need a new connection class for every type of block/waiting object. I\nthink this will spin out of control pretty fast, the next time we want\nsomething pluggable.  I think a compositional approach may be better:\n\nThe \u0027new\u0027 TransactionQueue\u0027s implementations (not the base class) can\nbe stand-alone objects. Then they can be reused if this sort of fd-based\nblocking is needed elsewhere. The base TransactionQueue class can remain\nas the old TransactionQueue class, but get a \u0027waiting object\u0027 either\nvia constructor, or via load-time tests like you did here.\n\nThen Connection can remain the same, except for the poller_block code. But\nyou can hide that difference inside \u0027avoid_block_call\u0027, or somehow\nmonkey_patch poller\u0027s block method.\n\nIn the end, the only difference between linux and windows code would be the\nwaiting-object implementation, which is the only object that is actually\ndifferent.","commit_id":"38e67ac3009cb8ffc5fccabc8516d76bd65f59d4"}],"ovsdbapp/backend/ovs_idl/common/base_connection_utils.py":[{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"7018396141af4e99755b140ee468ad5567fac074","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"class WaitQueue(object):"},{"line_number":17,"context_line":"    def __init__(self, max_queue_size):"},{"line_number":18,"context_line":"        self.max_queue_size \u003d max_queue_size"},{"line_number":19,"context_line":"        self.init_alert_notification()"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f1d235d_1bd66a29","line":16,"updated":"2017-07-06 14:16:15.000000000","message":"should probably be an ABC, but definitely not -1ing over that.","commit_id":"df0546f6215d4004f0b8e35d28a0b13fdaf982b7"}],"ovsdbapp/backend/ovs_idl/connection.py":[{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"58fadeb5454ed5573a4c267819366c010cbbfb38","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from ovsdbapp.backend.ovs_idl.common import utils"},{"line_number":27,"context_line":"from ovsdbapp.backend.ovs_idl import idlutils"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"if sys.platform \u003d\u003d \u0027win32\u0027:"},{"line_number":30,"context_line":"    # This contains all the utils needed for the Windows system"},{"line_number":31,"context_line":"    from ovs import winutils"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_3cb7df3c","line":29,"updated":"2017-05-01 15:45:43.000000000","message":"I really don\u0027t like all of the sys.platform checks. I\u0027d much rather see subclasses that are win32 specific and just import the platform-specific ones.","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"},{"author":{"_account_id":17019,"name":"Alin Balutoiu","email":"abalutoiu@cloudbasesolutions.com","username":"abalutoiu"},"change_message_id":"bdb863920f47ec2b74581e092ba434ebe8a227b4","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from ovsdbapp.backend.ovs_idl.common import utils"},{"line_number":27,"context_line":"from ovsdbapp.backend.ovs_idl import idlutils"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"if sys.platform \u003d\u003d \u0027win32\u0027:"},{"line_number":30,"context_line":"    # This contains all the utils needed for the Windows system"},{"line_number":31,"context_line":"    from ovs import winutils"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ff0f0b1f_bf093896","line":29,"in_reply_to":"5ff73747_3cb7df3c","updated":"2017-05-19 09:45:11.000000000","message":"Done","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"5e982720f7b00ef596bf60bbcfef796beb1c3286","unresolved":false,"context_lines":[{"line_number":34,"context_line":"class TransactionQueue(Queue.Queue, object):"},{"line_number":35,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":36,"context_line":"        super(TransactionQueue, self).__init__(*args, **kwargs)"},{"line_number":37,"context_line":"        if sys.platform !\u003d \u0027win32\u0027:"},{"line_number":38,"context_line":"            alertpipe \u003d os.pipe()"},{"line_number":39,"context_line":"            # NOTE(ivasilevskaya) python 3 doesn\u0027t allow unbuffered I/O."},{"line_number":40,"context_line":"            # Will get around this constraint by using binary mode."}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_35280d95","line":37,"range":{"start_line":37,"start_character":0,"end_line":37,"end_character":35},"updated":"2017-04-30 09:41:49.000000000","message":"In general about this change: Making in-line tests for the platform like this throughout the code is going to be virtually unmaintainable. Perhaps a better solution is to move cross-thread event signaling to an external module, and just using its api. Limit the platform testing to that module (and also, to the bare minimum).","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"023707429ec74add4c554c25eae0f2eac64d7ce8","unresolved":false,"context_lines":[{"line_number":34,"context_line":"class TransactionQueue(Queue.Queue, object):"},{"line_number":35,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":36,"context_line":"        super(TransactionQueue, self).__init__(*args, **kwargs)"},{"line_number":37,"context_line":"        if sys.platform !\u003d \u0027win32\u0027:"},{"line_number":38,"context_line":"            alertpipe \u003d os.pipe()"},{"line_number":39,"context_line":"            # NOTE(ivasilevskaya) python 3 doesn\u0027t allow unbuffered I/O."},{"line_number":40,"context_line":"            # Will get around this constraint by using binary mode."}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_d297b144","line":37,"range":{"start_line":37,"start_character":0,"end_line":37,"end_character":35},"in_reply_to":"5ff73747_35280d95","updated":"2017-05-01 15:48:33.000000000","message":"+1","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"},{"author":{"_account_id":17019,"name":"Alin Balutoiu","email":"abalutoiu@cloudbasesolutions.com","username":"abalutoiu"},"change_message_id":"bdb863920f47ec2b74581e092ba434ebe8a227b4","unresolved":false,"context_lines":[{"line_number":34,"context_line":"class TransactionQueue(Queue.Queue, object):"},{"line_number":35,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":36,"context_line":"        super(TransactionQueue, self).__init__(*args, **kwargs)"},{"line_number":37,"context_line":"        if sys.platform !\u003d \u0027win32\u0027:"},{"line_number":38,"context_line":"            alertpipe \u003d os.pipe()"},{"line_number":39,"context_line":"            # NOTE(ivasilevskaya) python 3 doesn\u0027t allow unbuffered I/O."},{"line_number":40,"context_line":"            # Will get around this constraint by using binary mode."}],"source_content_type":"text/x-python","patch_set":6,"id":"ff0f0b1f_9f355449","line":37,"range":{"start_line":37,"start_character":0,"end_line":37,"end_character":35},"in_reply_to":"5ff73747_35280d95","updated":"2017-05-19 09:45:11.000000000","message":"Done","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"},{"author":{"_account_id":17019,"name":"Alin Balutoiu","email":"abalutoiu@cloudbasesolutions.com","username":"abalutoiu"},"change_message_id":"bdb863920f47ec2b74581e092ba434ebe8a227b4","unresolved":false,"context_lines":[{"line_number":34,"context_line":"class TransactionQueue(Queue.Queue, object):"},{"line_number":35,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":36,"context_line":"        super(TransactionQueue, self).__init__(*args, **kwargs)"},{"line_number":37,"context_line":"        if sys.platform !\u003d \u0027win32\u0027:"},{"line_number":38,"context_line":"            alertpipe \u003d os.pipe()"},{"line_number":39,"context_line":"            # NOTE(ivasilevskaya) python 3 doesn\u0027t allow unbuffered I/O."},{"line_number":40,"context_line":"            # Will get around this constraint by using binary mode."}],"source_content_type":"text/x-python","patch_set":6,"id":"ff0f0b1f_df2bcce8","line":37,"range":{"start_line":37,"start_character":0,"end_line":37,"end_character":35},"in_reply_to":"5ff73747_d297b144","updated":"2017-05-19 09:45:11.000000000","message":"Done","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"5e982720f7b00ef596bf60bbcfef796beb1c3286","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        else:"},{"line_number":60,"context_line":"            # Set the event object to the nonsignaled state to indicate that"},{"line_number":61,"context_line":"            # the queue is empty."},{"line_number":62,"context_line":"            winutils.win32event.ResetEvent(self.alert_event)"},{"line_number":63,"context_line":"        return result"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def put(self, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_909a4fb6","line":62,"range":{"start_line":62,"start_character":0,"end_line":62,"end_character":60},"updated":"2017-04-30 09:41:49.000000000","message":"The pattern here is different than the linux one: In linux, you have a pattern similar to a counting semaphore. Every message added to the queue increases the semaphore count, and every message removed decreases. The blocking is done when you try to \u0027decrease\u0027 the count (check if you can read a byte of the pipe).\n\nIn windows, the pattern is more like a binary semaphore - every message \u0027Sets\u0027 the semaphore to 1, and the get \u0027Resets\u0027 the semaphore to 0.\n\nThis means that if multiple messages are added, and one is removed, a block may occur even if one is not needed","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"},{"author":{"_account_id":17019,"name":"Alin Balutoiu","email":"abalutoiu@cloudbasesolutions.com","username":"abalutoiu"},"change_message_id":"bdb863920f47ec2b74581e092ba434ebe8a227b4","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        else:"},{"line_number":60,"context_line":"            # Set the event object to the nonsignaled state to indicate that"},{"line_number":61,"context_line":"            # the queue is empty."},{"line_number":62,"context_line":"            winutils.win32event.ResetEvent(self.alert_event)"},{"line_number":63,"context_line":"        return result"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def put(self, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_abd27acf","line":62,"range":{"start_line":62,"start_character":0,"end_line":62,"end_character":60},"in_reply_to":"5ff73747_909a4fb6","updated":"2017-05-19 09:45:11.000000000","message":"I wrote previously as a note that the assumption made is that the queue has length 1, which is our case if you look in the Connection class. This means that we cannot add multiple messages since the \"put\" on the queue will block until there is enough space to put it. I also made a suggestion on what needs to change if we are going to allow multiple messages, you can find it in the description of the note from init.","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"5e982720f7b00ef596bf60bbcfef796beb1c3286","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                # Ensure that WaitForMultipleObjects will not block other"},{"line_number":180,"context_line":"                # greenthreads. poller.block uses WaitForMultipleObjects on"},{"line_number":181,"context_line":"                # Windows"},{"line_number":182,"context_line":"                utils.avoid_blocking_call(self.poller.block)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"            self.idl.run()"},{"line_number":185,"context_line":"            txn \u003d self.txns.get_nowait()"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_703903d5","line":182,"range":{"start_line":182,"start_character":0,"end_line":182,"end_character":60},"updated":"2017-04-30 09:41:49.000000000","message":"Doesn\u0027t this miss the point? poller.block is supposed to block *this* thread before calling idl.run. This way, idl.run is called even if poller is still blocking on another thread.","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"},{"author":{"_account_id":17019,"name":"Alin Balutoiu","email":"abalutoiu@cloudbasesolutions.com","username":"abalutoiu"},"change_message_id":"bdb863920f47ec2b74581e092ba434ebe8a227b4","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                # Ensure that WaitForMultipleObjects will not block other"},{"line_number":180,"context_line":"                # greenthreads. poller.block uses WaitForMultipleObjects on"},{"line_number":181,"context_line":"                # Windows"},{"line_number":182,"context_line":"                utils.avoid_blocking_call(self.poller.block)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"            self.idl.run()"},{"line_number":185,"context_line":"            txn \u003d self.txns.get_nowait()"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_ebf52258","line":182,"range":{"start_line":182,"start_character":0,"end_line":182,"end_character":60},"in_reply_to":"5ff73747_703903d5","updated":"2017-05-19 09:45:11.000000000","message":"This does not miss the point. On Linux, poller.block uses select which is monkey patched and works well on greenthreads. This will just create the call in another thread, but the greenthread will be waiting for the other thread (with poller.block) to finish before continuing. If we do not do this, then all the greenthreads will be blocked since WaitForMultipleObjects it\u0027s not monkey patched and does not work well with eventlet. Greenthreads run in a single native thread, when calling WaitForMultipleObjects will block the native thread which results in blocking all the greenthreads running inside the native thread. With this call we avoid blocking the native thread by spawning a new native thread to execute the call and the greenthread from the first native thread will wait for the new native thread to finish.","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"}],"ovsdbapp/backend/ovs_idl/vlog.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"5e982720f7b00ef596bf60bbcfef796beb1c3286","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"def use_python_logger():"},{"line_number":24,"context_line":"    \"\"\"Replace the OVS IDL logger functions with our logger\"\"\""},{"line_number":25,"context_line":"    if sys.platform \u003d\u003d \u0027win32\u0027:"},{"line_number":26,"context_line":"        # NOTE(abalutoiu) When using oslo logging we need to keep in mind that"},{"line_number":27,"context_line":"        # it does not work well with native threads. We need to be careful when"},{"line_number":28,"context_line":"        # we call eventlet.tpool.execute, and make sure that it will not use"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_50904795","line":25,"range":{"start_line":25,"start_character":0,"end_line":25,"end_character":31},"updated":"2017-04-30 09:41:49.000000000","message":"Will this be needed if utils.avoid_blocking_call is not used?","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"},{"author":{"_account_id":17019,"name":"Alin Balutoiu","email":"abalutoiu@cloudbasesolutions.com","username":"abalutoiu"},"change_message_id":"bdb863920f47ec2b74581e092ba434ebe8a227b4","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"def use_python_logger():"},{"line_number":24,"context_line":"    \"\"\"Replace the OVS IDL logger functions with our logger\"\"\""},{"line_number":25,"context_line":"    if sys.platform \u003d\u003d \u0027win32\u0027:"},{"line_number":26,"context_line":"        # NOTE(abalutoiu) When using oslo logging we need to keep in mind that"},{"line_number":27,"context_line":"        # it does not work well with native threads. We need to be careful when"},{"line_number":28,"context_line":"        # we call eventlet.tpool.execute, and make sure that it will not use"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_abeb9a75","line":25,"range":{"start_line":25,"start_character":0,"end_line":25,"end_character":31},"in_reply_to":"5ff73747_50904795","updated":"2017-05-19 09:45:11.000000000","message":"This is not needed if utils.avoid_blocking_call is not used. But we still need to use utils.avoid_blocking_call for the call poller.block, so this will be needed.","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"8b4316d5833d88bf42eb2bcdc7286170a4bfad83","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    :param: max_level: the maximum level to log"},{"line_number":56,"context_line":"    :type: max_level: vlog level, CRITICAL, ERROR, WARN, INFO, or DEBUG"},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":"    if sys.platform \u003d\u003d \u0027win32\u0027:"},{"line_number":59,"context_line":"        # NOTE(abalutoiu) When using oslo logging we need to keep in mind that"},{"line_number":60,"context_line":"        # it does not work well with native threads. We need to be careful when"},{"line_number":61,"context_line":"        # we call eventlet.tpool.execute, and make sure that it will not use"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_6a73b84e","line":58,"range":{"start_line":58,"start_character":0,"end_line":58,"end_character":31},"updated":"2017-05-21 09:41:46.000000000","message":"This block assumes we use oslo.logger. Is there a way to verify that? Is this still relevant for standard python logger? This sounds like a bug in oslo.logger. Do they have a bug open for it?","commit_id":"fd58f65bee0f69ee8383b70d1ab36704a0d51b3d"},{"author":{"_account_id":17019,"name":"Alin Balutoiu","email":"abalutoiu@cloudbasesolutions.com","username":"abalutoiu"},"change_message_id":"4afaecab08b8d957ec11f3cbbf103940441a6e88","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    :param: max_level: the maximum level to log"},{"line_number":56,"context_line":"    :type: max_level: vlog level, CRITICAL, ERROR, WARN, INFO, or DEBUG"},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":"    if sys.platform \u003d\u003d \u0027win32\u0027:"},{"line_number":59,"context_line":"        # NOTE(abalutoiu) When using oslo logging we need to keep in mind that"},{"line_number":60,"context_line":"        # it does not work well with native threads. We need to be careful when"},{"line_number":61,"context_line":"        # we call eventlet.tpool.execute, and make sure that it will not use"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_ca3f6423","line":58,"range":{"start_line":58,"start_character":0,"end_line":58,"end_character":31},"in_reply_to":"ff0f0b1f_6a73b84e","updated":"2017-05-21 10:15:14.000000000","message":"This affects only oslo logging. The comment states the fact that we need eventlet.tpool.execute for a call to ovs lib which tries to log something. In this case we are going to mix native threads with greenthreads when we do logging. There is no bug in oslo.logger. I think a better way would be to also check here if the threading module is monkey_patched, because we will not need this otherwise.","commit_id":"fd58f65bee0f69ee8383b70d1ab36704a0d51b3d"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"313c4d8986bb10042e93cbbbb5a3d5efd1bfe9da","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    :param: max_level: the maximum level to log"},{"line_number":56,"context_line":"    :type: max_level: vlog level, CRITICAL, ERROR, WARN, INFO, or DEBUG"},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":"    if sys.platform \u003d\u003d \u0027win32\u0027:"},{"line_number":59,"context_line":"        # NOTE(abalutoiu) When using oslo logging we need to keep in mind that"},{"line_number":60,"context_line":"        # it does not work well with native threads. We need to be careful when"},{"line_number":61,"context_line":"        # we call eventlet.tpool.execute, and make sure that it will not use"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_d65a67f1","line":58,"range":{"start_line":58,"start_character":0,"end_line":58,"end_character":31},"in_reply_to":"ff0f0b1f_ca3f6423","updated":"2017-05-22 06:18:08.000000000","message":"\u003e I think a better way would be to also check here if the threading module is monkey_patched, because we will not need this otherwise.\n\nSounds good enough.","commit_id":"fd58f65bee0f69ee8383b70d1ab36704a0d51b3d"},{"author":{"_account_id":17019,"name":"Alin Balutoiu","email":"abalutoiu@cloudbasesolutions.com","username":"abalutoiu"},"change_message_id":"957ff29610096627d2af6fb7a2f18f13fb6954cb","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    :param: max_level: the maximum level to log"},{"line_number":56,"context_line":"    :type: max_level: vlog level, CRITICAL, ERROR, WARN, INFO, or DEBUG"},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":"    if sys.platform \u003d\u003d \u0027win32\u0027:"},{"line_number":59,"context_line":"        # NOTE(abalutoiu) When using oslo logging we need to keep in mind that"},{"line_number":60,"context_line":"        # it does not work well with native threads. We need to be careful when"},{"line_number":61,"context_line":"        # we call eventlet.tpool.execute, and make sure that it will not use"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_f89b14c6","line":58,"range":{"start_line":58,"start_character":0,"end_line":58,"end_character":31},"in_reply_to":"ff0f0b1f_d65a67f1","updated":"2017-05-22 12:57:34.000000000","message":"Done","commit_id":"fd58f65bee0f69ee8383b70d1ab36704a0d51b3d"}],"ovsdbapp/backend/ovs_idl/windows/utils.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"8b4316d5833d88bf42eb2bcdc7286170a4bfad83","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    eventlet \u003d None"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"def avoid_blocking_call(f, *args, **kwargs):"},{"line_number":24,"context_line":"    \"\"\"Ensure that the method \"f\" will not block other greenthreads."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    Performs the call to the function \"f\" received as parameter in a"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_6f9aaa6e","line":23,"range":{"start_line":23,"start_character":4,"end_line":23,"end_character":23},"updated":"2017-05-21 09:41:46.000000000","message":"In this case, I\u0027d rename this function to: make_block_green or green_block, to make the meaning more clear.","commit_id":"fd58f65bee0f69ee8383b70d1ab36704a0d51b3d"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"313c4d8986bb10042e93cbbbb5a3d5efd1bfe9da","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    eventlet \u003d None"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"def avoid_blocking_call(f, *args, **kwargs):"},{"line_number":24,"context_line":"    \"\"\"Ensure that the method \"f\" will not block other greenthreads."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    Performs the call to the function \"f\" received as parameter in a"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_9674ef69","line":23,"range":{"start_line":23,"start_character":4,"end_line":23,"end_character":23},"in_reply_to":"ff0f0b1f_4a07d483","updated":"2017-05-22 06:18:08.000000000","message":"I disagree, but will not force the issue if outvoted.","commit_id":"fd58f65bee0f69ee8383b70d1ab36704a0d51b3d"},{"author":{"_account_id":17019,"name":"Alin Balutoiu","email":"abalutoiu@cloudbasesolutions.com","username":"abalutoiu"},"change_message_id":"4afaecab08b8d957ec11f3cbbf103940441a6e88","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    eventlet \u003d None"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"def avoid_blocking_call(f, *args, **kwargs):"},{"line_number":24,"context_line":"    \"\"\"Ensure that the method \"f\" will not block other greenthreads."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    Performs the call to the function \"f\" received as parameter in a"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_4a07d483","line":23,"range":{"start_line":23,"start_character":4,"end_line":23,"end_character":23},"in_reply_to":"ff0f0b1f_6f9aaa6e","updated":"2017-05-21 10:15:14.000000000","message":"I think avoid_blocking_call fits for this function name. Since this method is making sure that the function f will not block other greenthreads from the same native thread.","commit_id":"fd58f65bee0f69ee8383b70d1ab36704a0d51b3d"},{"author":{"_account_id":17019,"name":"Alin Balutoiu","email":"abalutoiu@cloudbasesolutions.com","username":"abalutoiu"},"change_message_id":"957ff29610096627d2af6fb7a2f18f13fb6954cb","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    eventlet \u003d None"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"def avoid_blocking_call(f, *args, **kwargs):"},{"line_number":24,"context_line":"    \"\"\"Ensure that the method \"f\" will not block other greenthreads."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    Performs the call to the function \"f\" received as parameter in a"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_3864ece3","line":23,"range":{"start_line":23,"start_character":4,"end_line":23,"end_character":23},"in_reply_to":"ff0f0b1f_9674ef69","updated":"2017-05-22 12:57:34.000000000","message":"Let\u0027s hear other reviewers opinion on this. Also the documentation below should be pretty clear on what the method is doing.","commit_id":"fd58f65bee0f69ee8383b70d1ab36704a0d51b3d"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"8b4316d5833d88bf42eb2bcdc7286170a4bfad83","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    # Note that eventlet.getcurrent will always return a greenlet object."},{"line_number":38,"context_line":"    # In case of a greenthread, the parent greenlet will always be the hub"},{"line_number":39,"context_line":"    # loop greenlet."},{"line_number":40,"context_line":"    if eventlet.getcurrent().parent:"},{"line_number":41,"context_line":"        return tpool.execute(f, *args, **kwargs)"},{"line_number":42,"context_line":"    else:"},{"line_number":43,"context_line":"        return f(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_2aedc024","line":40,"range":{"start_line":40,"start_character":0,"end_line":40,"end_character":36},"updated":"2017-05-21 09:41:46.000000000","message":"Is this the best way to check if this is a greenthread? What about eventlet.patcher.is_monkey_patched(\u0027thread\u0027) ?\n\nIn a simple test I ran, the main thread returns here None as well, after calling eventlet.monkey_patch.","commit_id":"fd58f65bee0f69ee8383b70d1ab36704a0d51b3d"},{"author":{"_account_id":17019,"name":"Alin Balutoiu","email":"abalutoiu@cloudbasesolutions.com","username":"abalutoiu"},"change_message_id":"4afaecab08b8d957ec11f3cbbf103940441a6e88","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    # Note that eventlet.getcurrent will always return a greenlet object."},{"line_number":38,"context_line":"    # In case of a greenthread, the parent greenlet will always be the hub"},{"line_number":39,"context_line":"    # loop greenlet."},{"line_number":40,"context_line":"    if eventlet.getcurrent().parent:"},{"line_number":41,"context_line":"        return tpool.execute(f, *args, **kwargs)"},{"line_number":42,"context_line":"    else:"},{"line_number":43,"context_line":"        return f(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_aaf55085","line":40,"range":{"start_line":40,"start_character":0,"end_line":40,"end_character":36},"in_reply_to":"ff0f0b1f_2aedc024","updated":"2017-05-21 10:15:14.000000000","message":"It is expected for this call to return None in the main thread since that will always be a native thread. The native threads do not have any parents, hence they are not greenthreads. We are interested only in the greenthreads here.","commit_id":"fd58f65bee0f69ee8383b70d1ab36704a0d51b3d"},{"author":{"_account_id":17019,"name":"Alin Balutoiu","email":"abalutoiu@cloudbasesolutions.com","username":"abalutoiu"},"change_message_id":"957ff29610096627d2af6fb7a2f18f13fb6954cb","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    # Note that eventlet.getcurrent will always return a greenlet object."},{"line_number":38,"context_line":"    # In case of a greenthread, the parent greenlet will always be the hub"},{"line_number":39,"context_line":"    # loop greenlet."},{"line_number":40,"context_line":"    if eventlet.getcurrent().parent:"},{"line_number":41,"context_line":"        return tpool.execute(f, *args, **kwargs)"},{"line_number":42,"context_line":"    else:"},{"line_number":43,"context_line":"        return f(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_583c40be","line":40,"range":{"start_line":40,"start_character":0,"end_line":40,"end_character":36},"in_reply_to":"ff0f0b1f_3669a38a","updated":"2017-05-22 12:57:34.000000000","message":"Even if we reach here from the main thread, that will not be a problem. The if condition will be False we are going to call the function directly.","commit_id":"fd58f65bee0f69ee8383b70d1ab36704a0d51b3d"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"313c4d8986bb10042e93cbbbb5a3d5efd1bfe9da","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    # Note that eventlet.getcurrent will always return a greenlet object."},{"line_number":38,"context_line":"    # In case of a greenthread, the parent greenlet will always be the hub"},{"line_number":39,"context_line":"    # loop greenlet."},{"line_number":40,"context_line":"    if eventlet.getcurrent().parent:"},{"line_number":41,"context_line":"        return tpool.execute(f, *args, **kwargs)"},{"line_number":42,"context_line":"    else:"},{"line_number":43,"context_line":"        return f(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_3669a38a","line":40,"range":{"start_line":40,"start_character":0,"end_line":40,"end_character":36},"in_reply_to":"ff0f0b1f_aaf55085","updated":"2017-05-22 06:18:08.000000000","message":"And we assume we don\u0027t reach here from the main thread. Got it.","commit_id":"fd58f65bee0f69ee8383b70d1ab36704a0d51b3d"}],"ovsdbapp/tests/unit/backend/ovs_idl/test_connection.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"5e982720f7b00ef596bf60bbcfef796beb1c3286","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        self._mock_os \u003d mock_os"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        self._mock_sys \u003d mock.MagicMock()"},{"line_number":39,"context_line":"        self._mock_sys.platform.return_value \u003d \u0027linux2\u0027"},{"line_number":40,"context_line":"        sys_patcher \u003d mock.patch.object(connection, \u0027sys\u0027, new\u003dself._mock_sys)"},{"line_number":41,"context_line":"        sys_patcher.start()"},{"line_number":42,"context_line":"        self.addCleanup(mock.patch.stopall)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_35f7ed5b","line":39,"range":{"start_line":39,"start_character":48,"end_line":39,"end_character":54},"updated":"2017-04-30 09:41:49.000000000","message":"If you take my suggestion of moving the \u0027wait\u0027 code do a different module, this code can be broken down to multiple test modules:\n1. Test the \u0027wait\u0027 module\n2. Test the connection so that it calls the module correctly.\n3. A functional test verifying the integration (This may already be covered by other tests. If that\u0027s the case, maybe it\u0027s not needed)","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"58fadeb5454ed5573a4c267819366c010cbbfb38","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        self._transaction_queue \u003d connection.TransactionQueue("},{"line_number":45,"context_line":"            self.FAKE_QUEUE_SIZE)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_init(self):"},{"line_number":48,"context_line":"        self._mock_os.pipe.assert_called_once_with()"},{"line_number":49,"context_line":"        self._mock_os.fdopen.assert_has_calls(["},{"line_number":50,"context_line":"            mock.call(self._mock_os.pipe.return_value[0], \u0027rb\u0027, 0),"}],"source_content_type":"text/x-python","patch_set":6,"id":"5ff73747_bc588ff9","line":47,"updated":"2017-05-01 15:45:43.000000000","message":"I get that this is how unit test code all over OpenStack looks, but I *really* don\u0027t like unit tests where we just check that we call implementation-specific things. That we currently call them doesn\u0027t tell us anything about whether they *should* be called. If we change the code to something that does an equivalent thing (i.e. refactoring), then we just have to write the test over so we can\u0027t use the test to see if we ended up breaking anything by refactoring.\n\nWho cares if we call pipe() and fdopen() for instance instead of something completely different? It tells us nothing about whether or not the code is correct. The test just tells us that that code hasn\u0027t been touched and gives us the opportunity to write the code twice any time we make a change.\n\n\u003c/rant\u003e","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"}],"requirements.txt":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"5e982720f7b00ef596bf60bbcfef796beb1c3286","unresolved":false,"context_lines":[{"line_number":4,"context_line":""},{"line_number":5,"context_line":"ovs\u003e\u003d2.7.0 # Apache-2.0"},{"line_number":6,"context_line":"pbr!\u003d2.1.0,\u003e\u003d2.0.0 # Apache-2.0"},{"line_number":7,"context_line":"eventlet!\u003d0.18.3,\u003e\u003d0.18.2  # MIT"}],"source_content_type":"text/plain","patch_set":6,"id":"5ff73747_f5f50558","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":8},"updated":"2017-04-30 09:41:49.000000000","message":"This should be avoided. As a library, we shouldn\u0027t force the installation of eventlet. There are ways to test if the library is installed, and behave differently if it isn\u0027t.\n\nI think however, that this can be avoided altogether.","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"},{"author":{"_account_id":17019,"name":"Alin Balutoiu","email":"abalutoiu@cloudbasesolutions.com","username":"abalutoiu"},"change_message_id":"bdb863920f47ec2b74581e092ba434ebe8a227b4","unresolved":false,"context_lines":[{"line_number":4,"context_line":""},{"line_number":5,"context_line":"ovs\u003e\u003d2.7.0 # Apache-2.0"},{"line_number":6,"context_line":"pbr!\u003d2.1.0,\u003e\u003d2.0.0 # Apache-2.0"},{"line_number":7,"context_line":"eventlet!\u003d0.18.3,\u003e\u003d0.18.2  # MIT"}],"source_content_type":"text/plain","patch_set":6,"id":"5ff73747_aba03a43","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":8},"in_reply_to":"5ff73747_f5f50558","updated":"2017-05-19 09:45:11.000000000","message":"You are right. The installation of eventlet is not required anymore. The code will behave differently if eventlet is not installed.","commit_id":"d94e7a19e3e5f86ab9a3a6f7731b71379cf4f8d1"}]}
