MCPcopy
hub / github.com/celery/celery / on_process_down

Method on_process_down

celery/concurrency/asynpool.py:686–713  ·  view source on GitHub ↗

Called when a worker process exits.

(proc)

Source from the content-addressed store, hash-verified

684 return fd
685
686 def on_process_down(proc):
687 """Called when a worker process exits."""
688 if getattr(proc, 'dead', None):
689 return
690 process_flush_queues(proc)
691 _remove_from_index(
692 proc.outq._reader, proc, fileno_to_outq, remove_reader,
693 )
694 if proc.synq:
695 _remove_from_index(
696 proc.synq._writer, proc, fileno_to_synq, remove_writer,
697 )
698 inq = _remove_from_index(
699 proc.inq._writer, proc, fileno_to_inq, remove_writer,
700 callback=all_inqueues.discard,
701 )
702 if inq:
703 busy_workers.discard(inq)
704 self._untrack_child_process(proc, hub)
705 waiting_to_start.discard(proc)
706 self._active_writes.discard(proc.inqW_fd)
707 remove_writer(proc.inq._writer)
708 remove_reader(proc.outq._reader)
709 if proc.synqR_fd:
710 remove_reader(proc.synq._reader)
711 if proc.synqW_fd:
712 self._active_writes.discard(proc.synqW_fd)
713 remove_reader(proc.synq._writer)
714 self.on_process_down = on_process_down
715
716 def _create_write_handlers(self, hub,

Callers

nothing calls this directly

Calls 2

discardMethod · 0.45

Tested by

no test coverage detected