6859de28d45e68228929c43637e46cec17a93227,parlai/mturk/core/mturk_manager.py,MTurkManager,_on_socket_dead,#MTurkManager#Any#Any#,597

Before Change


        elif agent.state.status == AssignState.STATUS_IN_TASK:
            self._handle_worker_disconnect(worker_id, assignment_id)
            agent.disconnected = True
        elif agent.state.status == AssignState.STATUS_DONE:
            // It"s okay if a complete assignment socket dies, but wait for the
            // world to clean up the resource
            return
        elif agent.state.status == AssignState.STATUS_ASSIGNED:
            // mark the agent in the assigned state as disconnected, the task
            // spawn thread is responsible for cleanup
            agent.state.status = AssignState.STATUS_DISCONNECT
            agent.disconnected = True

        self.socket_manager.close_channel(agent.get_connection_id())

After Change


        elif agent.get_status() == AssignState.STATUS_ONBOARDING:
            // Agent never made it to task pool, the onboarding thread will die
            // and delete the agent if we mark it as a disconnect
            agent.set_status(AssignState.STATUS_DISCONNECT)
            agent.reduce_state()
            agent.disconnected = True
        elif agent.get_status() == AssignState.STATUS_WAITING:
            // agent is in pool, remove from pool and delete
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: facebookresearch/ParlAI
Commit Name: 6859de28d45e68228929c43637e46cec17a93227
Time: 2018-08-24
Author: jju@fb.com
File Name: parlai/mturk/core/mturk_manager.py
Class Name: MTurkManager
Method Name: _on_socket_dead


Project Name: facebookresearch/ParlAI
Commit Name: 6859de28d45e68228929c43637e46cec17a93227
Time: 2018-08-24
Author: jju@fb.com
File Name: parlai/mturk/core/mturk_manager.py
Class Name: MTurkManager
Method Name: mark_workers_done


Project Name: facebookresearch/ParlAI
Commit Name: 6859de28d45e68228929c43637e46cec17a93227
Time: 2018-08-24
Author: jju@fb.com
File Name: parlai/mturk/core/mturk_manager.py
Class Name: MTurkManager
Method Name: force_expire_hit