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