Opened 4 years ago

Closed 3 years ago

#7525 defect closed duplicate (duplicate)

spawnProcess hangs when run a lot

Reported by: Glyph Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author:

Description

This script eventually hangs hard (C-c is blocked) if I run it for a while on my mac. It looks like some low-level bug in Python signal handling. While the eventual hang is reliable, it takes between 100 and 1000 seconds to get stuck.

from __future__ import print_function

from itertools import count
import sys
import twisted

from twisted.internet.utils import getProcessValue as do
from twisted.internet.task import LoopingCall, react

counter = count()

def batch():
    print("Tick:", next(counter))
    for _ in range(80):
        do("/usr/bin/true")

def start(reactor):
    print("running twisted", twisted.version,
          "on python", sys.version)
    c = LoopingCall(batch)
    return c.start(1.0)

react(start, [])

(I could swear this bug is a duplicate but I can't find it anywhere. I know that I got the basic skeleton of this script from a user though, possibly on the mailing list.)

Attachments (1)

blocked.txt (20.7 KB) - added by Glyph 4 years ago.
output of "sample"

Download all attachments as: .zip

Change History (2)

Changed 4 years ago by Glyph

Attachment: blocked.txt added

output of "sample"

comment:1 Changed 3 years ago by Glyph

Resolution: duplicate
Status: newclosed

Okay, it was a duplicate, of #6972.

Note: See TracTickets for help on using tickets.