Project

General

Profile

Bug #15398

TestThread#test_signal_at_join fails on FreeBSD

Added by naruse (Yui NARUSE) 5 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:90417]

Description

Since r64538 or r64539, TestThread#test_signal_at_join is failing on our FreeBSD CI.

+ <n>) Error:
+TestThread#test_signal_at_join:
+Timeout::Error: execution of assert_separately expired timeout (120 sec)
+pid 80587 killed by SIGTERM (signal 15)
+| BAhvOhRTaWduYWxFeGNlcHRpb24KOgltZXNnIgxTSUdURVJNOgdidFsMSSIU
+| LTozNzppbiBgd3JpdGUnBjoGRUZJIhMtOjM3OmluIGBwdXRzJwY7CEZJIikt
+| OjM3OmluIGBibG9jayAoMiBsZXZlbHMpIGluIDxtYWluPicGOwhGSSIULToz
+| NDppbiBgdGltZXMnBjsIRkkiHi06MzQ6aW4gYGJsb2NrIGluIDxtYWluPicG
+| OwhGSSIULToxMDppbiBgcG9wZW4nBjsIRkkiFS06MTA6aW4gYDxtYWluPicG
+| OwhGOgpzaWdub2kUOgpjYXVzZTA6EWJ0X2xvY2F0aW9uc0AH
+| assertions=122
+|

https://rubyci.org/logs/rubyci.s3.amazonaws.com/freebsd11zfs/ruby-trunk/log/20180826T003001Z.diff.html.gz

Note that this doesn't happen on my private FreeBSD box.

Associated revisions

Revision 89db85f7
Added by normal 5 months ago

thread_pthread.c (native_sleep): sched_yield if GVL uncontended

Uncontended GVL waitqueue could mean a single CPU setup where
threads are starved and can't even insert themselves into our
waitqueue. So we force other threads to run upon releasing
the GVL in an uncontended state, in the hope that we can
avoid entering the slow path of ppoll and similar syscalls.

This should prevent test/ruby/test_thread.rb::test_signal_at_join
timeout problems on our single CPU FreeBSD CI machine.

[ruby-core:90417] [Bug #15398]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 66381
Added by normalperson (Eric Wong) 5 months ago

thread_pthread.c (native_sleep): sched_yield if GVL uncontended

Uncontended GVL waitqueue could mean a single CPU setup where
threads are starved and can't even insert themselves into our
waitqueue. So we force other threads to run upon releasing
the GVL in an uncontended state, in the hope that we can
avoid entering the slow path of ppoll and similar syscalls.

This should prevent test/ruby/test_thread.rb::test_signal_at_join
timeout problems on our single CPU FreeBSD CI machine.

[ruby-core:90417] [Bug #15398]

Revision 66381
Added by normal 5 months ago

thread_pthread.c (native_sleep): sched_yield if GVL uncontended

Uncontended GVL waitqueue could mean a single CPU setup where
threads are starved and can't even insert themselves into our
waitqueue. So we force other threads to run upon releasing
the GVL in an uncontended state, in the hope that we can
avoid entering the slow path of ppoll and similar syscalls.

This should prevent test/ruby/test_thread.rb::test_signal_at_join
timeout problems on our single CPU FreeBSD CI machine.

[ruby-core:90417] [Bug #15398]

History

Updated by normalperson (Eric Wong) 5 months ago

naruse@airemix.jp wrote:

https://bugs.ruby-lang.org/issues/15398

Odd, r65495 could've solved it, but didn't...

https://rubyci.org/logs/rubyci.s3.amazonaws.com/freebsd11zfs/ruby-trunk/log/20180826T003001Z.diff.html.gz

Note that this doesn't happen on my private FreeBSD box.

Same here, no problem on my 11.2 VM. Any configuration differences?
I'll investigate more deeply in a few days. Connection is crap

Updated by normalperson (Eric Wong) 5 months ago

https://bugs.ruby-lang.org/issues/15398

OK, problem happens on single-CPU setup.

"cpuset -l 1 make ..." replicates the problem. Not sure what to
do about it, yet; need food :<

#4

Updated by normalperson (Eric Wong) 5 months ago

  • Status changed from Open to Closed

Applied in changeset trunk|r66381.


thread_pthread.c (native_sleep): sched_yield if GVL uncontended

Uncontended GVL waitqueue could mean a single CPU setup where
threads are starved and can't even insert themselves into our
waitqueue. So we force other threads to run upon releasing
the GVL in an uncontended state, in the hope that we can
avoid entering the slow path of ppoll and similar syscalls.

This should prevent test/ruby/test_thread.rb::test_signal_at_join
timeout problems on our single CPU FreeBSD CI machine.

[ruby-core:90417] [Bug #15398]

Also available in: Atom PDF