From: "ioquatix (Samuel Williams) via ruby-core" <ruby-core@ml.ruby-lang.org>
To: ruby-core@ml.ruby-lang.org
Cc: "ioquatix (Samuel Williams)" <noreply@ruby-lang.org>
Subject: [ruby-core:116535] [Ruby master Bug#20231] Don't wait in io_binwrite_string if not necessary.
Date: Thu, 01 Feb 2024 01:52:12 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-106552.20240201015211.3344@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-20231.20240201015202.3344@ruby-lang.org
Issue #20231 has been updated by ioquatix (Samuel Williams).
Assignee set to ioquatix (Samuel Williams)
----------------------------------------
Bug #20231: Don't wait in io_binwrite_string if not necessary.
https://bugs.ruby-lang.org/issues/20231#change-106552
* Author: ioquatix (Samuel Williams)
* Status: Open
* Priority: Normal
* Assignee: ioquatix (Samuel Williams)
* Backport: 3.2: REQUIRED, 3.3: REQUIRED
----------------------------------------
PR: https://github.com/ruby/ruby/pull/9792
Writing to a buffered IO can result in the entire internal buffer being flushed, which causes `io_binwrite_string_internal` to return 0. In that case, we were setting `errno = EAGAIN`. This causes `rb_io_maybe_wait_writable` to be invoked, however we should immediately retry `io_binwrite_string_internal` instead.
The reason why calling `rb_io_maybe_wait_writable` is a bad idea in general, is that not all IO can go via this mechanism in every situation - in other words, `kqueue` does not support `kevent("/dev/null", writable)` and returns errno=22 `EINVAL`. The same applies to some kinds of pipes, TTYs, etc.
Indirectly responsible for <https://github.com/socketry/async/issues/301>.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/
next prev parent reply other threads:[~2024-02-01 1:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-01 1:52 [ruby-core:116534] [Ruby master Bug#20231] Don't wait in io_binwrite_string if not necessary ioquatix (Samuel Williams) via ruby-core
2024-02-01 1:52 ` ioquatix (Samuel Williams) via ruby-core [this message]
2024-02-02 1:52 ` [ruby-core:116552] " naruse (Yui NARUSE) via ruby-core
2024-02-02 1:59 ` [ruby-core:116553] " ioquatix (Samuel Williams) via ruby-core
2024-02-05 8:06 ` [ruby-core:116583] " naruse (Yui NARUSE) via ruby-core
2024-02-05 14:43 ` [ruby-core:116587] " naruse (Yui NARUSE) via ruby-core
2024-03-31 10:19 ` [ruby-core:117385] " nagachika (Tomoyuki Chikanaga) via ruby-core
2024-04-01 8:17 ` [ruby-core:117394] " ioquatix (Samuel Williams) via ruby-core
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-106552.20240201015211.3344@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
--cc=noreply@ruby-lang.org \
--cc=ruby-core@ml.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).