Project

General

Profile

Actions

Bug #10044

closed

socket.write has different behaviors in process and thread

Added by tony.hu.hailin@gmail.com (Hailin Hu) over 9 years ago. Updated over 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-linux]
[ruby-core:63768]

Description

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) send_n_write.rb tony.hu.hailin@gmail.com (Hailin Hu), 07/16/2014 09:18 AM

Updated by akr (Akira Tanaka) over 7 years ago

  • Status changed from Open to Closed

I think this is fixed at r48476.

Actions

Also available in: Atom PDF

Like0
Like0