9ad1d2da68aa4acf817562502340bf319276b283,parlai/mturk/core/dev/socket_manager.py,SocketManager,close_channel,#SocketManager#Any#,627

Before Change


        self.run[connection_id] = False
        with self.thread_shutdown_lock:
            if connection_id in self.queues:
                while not self.queues[connection_id].empty():  // Empty queue
                    try:
                        item = self.queues[connection_id].get(block=False)
                        t = item[0]
                        packet = item[1]
                        if not packet:
                            continue
                        packet.requires_ack = False
                        packet.blocking = False
                        if packet.status is not Packet.STATUS_ACK:
                            self._send_packet(packet, connection_id, t)
                    except Empty:
                        break
                // Clean up packets
                with self.packet_map_lock:
                    packet_ids = list(self.packet_map.keys())
                    for packet_id in packet_ids:
                        packet = self.packet_map[packet_id]

After Change


            "Closing channel {}".format(connection_id)
        )
        if connection_id in self.open_channels:
            self.open_channels.remove(connection_id)
            with self.packet_map_lock:
                packet_ids = list(self.packet_map.keys())
                for packet_id in packet_ids:
                    packet = self.packet_map[packet_id]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: facebookresearch/ParlAI
Commit Name: 9ad1d2da68aa4acf817562502340bf319276b283
Time: 2019-05-14
Author: jju@fb.com
File Name: parlai/mturk/core/dev/socket_manager.py
Class Name: SocketManager
Method Name: close_channel


Project Name: biocore/scikit-bio
Commit Name: daf661c3edd949f8ac2cd70e4a725d9a055cc0c3
Time: 2016-06-27
Author: mcdonadt@colorado.edu
File Name: skbio/tree/_tree.py
Class Name: TreeNode
Method Name: shear


Project Name: autorope/donkeycar
Commit Name: c8e5a57b44aa57c820c87acb4521a44339680eac
Time: 2019-01-15
Author: tawnkramer@gmail.com
File Name: donkeycar/parts/network.py
Class Name: TCPServeValue
Method Name: send