[ruby-core:78006] [Ruby trunk Bug#10044][Closed] socket.write has different behaviors in process and thread

From: akr@...
Date: 2016-11-06 00:54:34 UTC
List: ruby-core #78006
Issue #10044 has been updated by Akira Tanaka.

Status changed from Open to Closed

I think this is fixed at r48476.

----------------------------------------
Bug #10044: socket.write has different behaviors in process and thread
https://bugs.ruby-lang.org/issues/10044#change-61347

* Author: Hailin Hu
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
It's a use case that sending message to syslog through unix socket.
My env is Amazon Linux 2013.09.

Run the script attached and check /var/log/message, you will see:
The result of socket.write in a thread is cut around 4KB, which seems like common PAGESIZE or something like that.
The other 3 cases are OK with the 5KB message.

According to "man 2 send", it is said "With zero flags argument, send() is equivalent to write(2)".
I'm not sure if it is the right reference. Is it an issue of ruby?

---Files--------------------------------
send_n_write.rb (502 Bytes)


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

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next