Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup dead children every seconds
  • Loading branch information
davies committed Aug 7, 2014
commit 03a2e8c9c31cc1dcf5b04612b85443c76953c9ce
7 changes: 4 additions & 3 deletions python/pyspark/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,16 @@ def handle_sigterm(*args):
try:
while True:
try:
ready_fds = select.select([0, listen_sock], [], [])[0]
ready_fds = select.select([0, listen_sock], [], [], 1)[0]
except select.error as ex:
if ex[0] == EINTR:
continue
else:
raise

# cleanup in signal handler will cause deadlock
cleanup_dead_children()

if 0 in ready_fds:
try:
worker_pid = read_int(sys.stdin)
Expand All @@ -145,8 +148,6 @@ def handle_sigterm(*args):
continue
raise

# cleanup in signal handler will cause deadlock
cleanup_dead_children()

# Launch a worker process
try:
Expand Down