From: lars@greiz-reinsdorf.de
To: ruby-core@ruby-lang.org
Subject: [ruby-core:90290] [Ruby trunk Feature#15350] [PATCH] thread_sync.c (queue_sleep): remove deadlock checking
Date: Tue, 04 Dec 2018 20:46:51 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-75397.20181204204650.09ac73ab112455a1@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-15350.20181127225205@ruby-lang.org
Issue #15350 has been updated by larskanis (Lars Kanis).
I agree with Jeremy, that dropping the deadlock detection from `Queue#pop` would be pity. It's a lot easier if you get a clear error message, than debugging a starvation in your process.
A common mistake in [Eventbox](https://github.com/larskanis/eventbox) is to forget to yield the result of a `yield_call`. This blocks the call forever:
```ruby
class MyBox < Eventbox
yield_call def init(result)
end
end
MyBox.new
```
Fortunately is is immediately raised through a `fatal (No live threads left. Deadlock?)` error, since Eventbox uses a Queue internally in this case. And the stacktrace points to the blocked `yield_call`, so that the developer gets a good indication about what's missing.
----------------------------------------
Feature #15350: [PATCH] thread_sync.c (queue_sleep): remove deadlock checking
https://bugs.ruby-lang.org/issues/15350#change-75397
* Author: normalperson (Eric Wong)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
thread_sync.c (queue_sleep): remove deadlock checking
Queue may be used inside signal handlers nowadays, so deadlock
checking is unnecessary and prevents single-threaded use.
We don't have deadlock checking for reading pipes/socket or
File#flock, either.
This IS a behavior change; but I don't think there is a risk
of incompatibility (aside from future code not working on old Rubies)
---Files--------------------------------
0001-thread_sync.c-queue_sleep-remove-deadlock-checking.patch (2.44 KB)
--
https://bugs.ruby-lang.org/
next prev parent reply other threads:[~2018-12-04 20:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-15350.20181127225205@ruby-lang.org>
2018-11-27 22:52 ` [ruby-core:90099] [Ruby trunk Feature#15350] [PATCH] thread_sync.c (queue_sleep): remove deadlock checking normalperson
2018-11-28 0:17 ` [ruby-core:90101] " merch-redmine
2018-11-28 2:54 ` [ruby-core:90107] " Eric Wong
2018-11-28 3:30 ` [ruby-core:90108] " merch-redmine
2018-11-28 5:01 ` [ruby-core:90109] " Eric Wong
2018-12-04 20:46 ` lars [this message]
2018-12-05 8:37 ` [ruby-core:90306] " Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-75397.20181204204650.09ac73ab112455a1@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).