Shutdown the manager process; will be registered as a finalizer
(process, address, authkey, state, _Client,
shutdown_timeout)
| 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): |