[Twisted-Python] flow testThreaded thingy
cce CVS wrote:
Modified files: Twisted/twisted/flow/threads.py 1.3 1.4
It seems that flows testing can pass 1% of the time and most of the time, it'll stop on testThreaded, as seen in the screen dump below: testProtocol ... [OK] testProtocolLocalhost ... [OK] testThreaded ... [OK] testThreadedSleep ... [OK] testThreadedYield ... [OK] testZip ... [OK] testZipFailure ... [OK] ------------------------------------------------------------------------------- Ran 26 tests in 2.927s OK [wari@sync wari]$ trial -v twisted.test.test_flow twisted.test.test_flow FlowTest testBasic ... [OK] [..snip..] testProtocolLocalhost ... [OK] testThreaded ... From here, I tried doing strace on the process and just got this: gettimeofday({1056703375, 307699}, NULL) = 0 select(8, [4 7], [], [], {0, 0}) = 0 (Timeout) gettimeofday({1056703375, 308951}, NULL) = 0 select(8, [4 7], [], [], {0, 0}) = 0 (Timeout) gettimeofday({1056703375, 310242}, NULL) = 0 select(8, [4 7], [], [], {0, 0}) = 0 (Timeout) gettimeofday({1056703375, 311093}, NULL) = 0 select(8, [4 7], [], [], {0, 0}) = 0 (Timeout) gettimeofday({1056703375, 311504}, NULL) = 0 select(8, [4 7], [], [], {0, 0}) = 0 (Timeout) gettimeofday({1056703375, 312164}, NULL) = 0 select(8, [4 7], [], [], {0, 0}) = 0 (Timeout) gettimeofday({1056703375, 312646}, NULL) = 0 select(8, [4 7], [], [], {0, 0}) = 0 (Timeout) gettimeofday({1056703375, 313504}, NULL) = 0 select(8, [4 7], [], [], {0, 0}) = 0 (Timeout) gettimeofday({1056703375, 313888}, NULL) = 0 select(8, [4 7], [], [], {0, 0} <unfinished ...> [wari@sync wari]$ Infinitely, of course.. Have not really gone thru the code at all, but anyway, my machine specs are the typical ones you get from johncompanies.com, Redhat 8.0, python 2.2.1, dual CPU and 2GB of RAM.
Hi, Wari Wahab wrote:
I tried doing strace on the process and just got this:
You can't strace a threaded process, at least not the main thread. This seems to be exactly the sort of almost-intractable timing-dependent problem which gives threading in general a well-deserved reputation for bugginess. :-/ I'll have a chance to dig around in flow+threading over the weekend. -- Matthias Urlichs | {M:U} IT Design @ m-u-it.de | smurf@smurf.noris.de Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de -- :kgbvax: /K-G-B'vaks/ n. See {kremvax}.
Matthias Urlichs wrote:
I tried doing strace on the process and just got this:
This seems to be exactly the sort of almost-intractable timing-dependent problem which gives threading in general a well-deserved reputation for bugginess. :-/
I'll have a chance to dig around in flow+threading over the weekend.
Oh btw, before you do more digging, I've tested the testThreaded thing again on a single CPU machine, and the result is pass everytime. I think this is more of a dual CPU issue, where out of ten times I runned twisted.test.test_flow, only one time it passes, and the rest of the test hangs on testThreaded. Also, the test passes everytime if I do 'trial -v twisted.test.test_flow.FlowTest.testThreaded' on the dual CPU. So I think that the other tests can affect the successful running of testThreaded.
Hi, Wari Wahab wrote:
Oh btw, before you do more digging, I've tested the testThreaded thing again on a single CPU machine, and the result is pass everytime.
Thanks for the additional info. I do have a dual-CPU system and some experience with threaded programs (Python and otherwise), so maybe I'll get lucky. Then again, this weekend is forecast to have much too good weather to sit in front of a computer the whole time. We'll see. ;-) -- Matthias Urlichs | {M:U} IT Design @ m-u-it.de | smurf@smurf.noris.de Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de -- Smile! You're on Candid Cookie!
On Fri, Jun 27, 2003 at 01:21:27PM +0200, Wari Wahab wrote: | Matthias Urlichs wrote: | >This seems to be exactly the sort of almost-intractable timing-dependent | >problem which gives threading in general a well-deserved reputation for | >bugginess. :-/ | | Oh btw, before you do more digging, I've tested the testThreaded thing | again on a single CPU machine, and the result is pass everytime. I think | this is more of a dual CPU issue, where out of ten times I runned | twisted.test.test_flow, only one time it passes, and the rest of the | test hangs on testThreaded. This could explain why it is a bit harder to produce. Anyway, I re-thought the logic and the current CVS version should be much cleaner, as I'm more careful about modifying shared variables only in the main thread (split process in two, one chunk per thread) Could you give it one more round-about? Best, Clark
participants (3)
-
Clark C. Evans
-
Matthias Urlichs
-
Wari Wahab