MCPcopy Index your code
hub / github.com/RustPython/RustPython / _finalize_manager

Method _finalize_manager

Lib/multiprocessing/managers.py:662–694  ·  view source on GitHub ↗

Shutdown the manager process; will be registered as a finalizer

(process, address, authkey, state, _Client,
                          shutdown_timeout)

Source from the content-addressed store, hash-verified

660
661 @staticmethod
662 def _finalize_manager(process, address, authkey, state, _Client,
663 shutdown_timeout):
664 '''
665 Shutdown the manager process; will be registered as a finalizer
666 '''
667 if process.is_alive():
668 util.info('sending shutdown message to manager')
669 try:
670 conn = _Client(address, authkey=authkey)
671 try:
672 dispatch(conn, None, 'shutdown')
673 finally:
674 conn.close()
675 except Exception:
676 pass
677
678 process.join(timeout=shutdown_timeout)
679 if process.is_alive():
680 util.info('manager still alive')
681 if hasattr(process, 'terminate'):
682 util.info('trying to `terminate()` manager process')
683 process.terminate()
684 process.join(timeout=shutdown_timeout)
685 if process.is_alive():
686 util.info('manager still alive after terminate')
687 process.kill()
688 process.join()
689
690 state.value = State.SHUTDOWN
691 try:
692 del BaseProxy._address_to_local[address]
693 except KeyError:
694 pass
695
696 @property
697 def address(self):

Callers

nothing calls this directly

Calls 8

hasattrFunction · 0.85
dispatchFunction · 0.70
is_aliveMethod · 0.45
infoMethod · 0.45
closeMethod · 0.45
joinMethod · 0.45
terminateMethod · 0.45
killMethod · 0.45

Tested by

no test coverage detected