Files | Admin

Notes:

Release Name: 2.8.1

Notes:
kgio 2.8.1 - minor improvements and test fixes

kgio provides non-blocking I/O methods for Ruby without raising
exceptions on EAGAIN and EINPROGRESS.  It is intended for use with the
Unicorn and Rainbows! Rack servers, but may be used by other
applications (that run on Unix-like platforms).

* http://bogomips.org/kgio/
* kgio@librelist.org
* git://bogomips.org/kgio.git
* http://bogomips.org/kgio/NEWS.atom.xml

Changes:

Improved error reporting for kgio_accept/kgio_tryaccept.
Minor size reduction throughout.  There are also several
test case fixes for race conditions.

Thanks to Hleb Valoshka and the Debian project for all the
help with this release!

Eric Wong (7):
      check syscall returns against < 0 instead of == -1
      accept: more informative exception on unknown family
      test_tryopen: skip EACCES test when euid == 0
      test/lib_read_write: account for larger-than-normal pipes
      test_poll: avoid potentially thread-unsafe test
      test_poll: preserve original trap(:USR1) handler
      test_poll: be less dependent on signal handler ordering

Hleb Valoshka (4):
      Change prefix of temporary sockets to prevent races
      Don't dump 20M in case of failure
      Create own directory for every unix socket in unit tests
      Close tempfile and unlink it immediately.



Changes: GIT-VERSION-GEN | 2 +- ext/kgio/accept.c | 8 +++++--- ext/kgio/connect.c | 8 ++++---- ext/kgio/nonblock.h | 6 +++++- ext/kgio/read_write.c | 6 +++--- ext/kgio/tryopen.c | 4 ++-- test/lib_read_write.rb | 18 ++++++++++++------ test/lib_server_accept.rb | 2 ++ test/test_autopush.rb | 3 +-- test/test_poll.rb | 15 ++++++++++----- test/test_tryopen.rb | 7 ++++++- test/test_unix_client_read_server_write.rb | 7 ++++--- test/test_unix_connect.rb | 8 +++++--- test/test_unix_server.rb | 7 ++++--- test/test_unix_server_read_client_write.rb | 7 ++++--- 15 files changed, 68 insertions(+), 40 deletions(-) commit 9bde3ab9a7e6e1776ba43bd0e7a3e9202f1026f6 Author: Eric Wong Date: Wed Sep 11 00:01:21 2013 +0000 kgio 2.8.1 - minor improvements and test fixes Improved error reporting for kgio_accept/kgio_tryaccept. Minor size reduction throughout. There are also several test case fixes for race conditions. Thanks to Hleb Valoshka and the Debian project for all the help with this release! Eric Wong (7): check syscall returns against < 0 instead of == -1 accept: more informative exception on unknown family test_tryopen: skip EACCES test when euid == 0 test/lib_read_write: account for larger-than-normal pipes test_poll: avoid potentially thread-unsafe test test_poll: preserve original trap(:USR1) handler test_poll: be less dependent on signal handler ordering Hleb Valoshka (4): Change prefix of temporary sockets to prevent races Don't dump 20M in case of failure Create own directory for every unix socket in unit tests Close tempfile and unlink it immediately. commit c3be428c452fd9c91d31b5b7d5b697175b6652df Author: Hleb Valoshka <375gnu@gmail.com> Date: Sat Sep 7 23:07:36 2013 +0300 Close tempfile and unlink it immediately. When a Tempfile object is garbage collected, or when the Ruby interpreter exits, its associated temporary file is automatically deleted. This may lead to race condition when Tempfile is used like in these tests. Signed-off-by: Eric Wong commit ff940137dc5098c9d8094e041e9be053cb3e139f Author: Eric Wong Date: Thu Sep 5 23:11:59 2013 +0000 test_poll: be less dependent on signal handler ordering Just spam the thread several times to force the wakeup to happen and not be as dependent on signal handler execution ordering of different Ruby VMs. Tested-by: Hleb Valoshka <375gnu@gmail.com> commit 90340eb8f2c5bf820eabd3c25fb39e45285b1c40 Author: Hleb Valoshka <375gnu@gmail.com> Date: Wed Sep 4 15:07:19 2013 +0300 Create own directory for every unix socket in unit tests [ew: this avoids a TOCTOU issue for multiple test invocations] Signed-off-by: Eric Wong commit 71f656e40de99d240c873ebb23451f76e46e5a20 Author: Eric Wong Date: Tue Sep 3 22:47:20 2013 +0000 test_poll: preserve original trap(:USR1) handler The existing SIGUSR1 handler may not always be "DEFAULT", so restore the original one. commit 377028d998f32c9bf8926a275019445103328c3d Author: Eric Wong Date: Tue Sep 3 22:45:26 2013 +0000 test_poll: avoid potentially thread-unsafe test Modifying pollset in a different pollset is thread-unsafe, so just do that inside the signal handler as that should fire before restarting poll(). commit 259347346169d4a2ab5b33719fe0985edc64bd3c Author: Eric Wong Date: Tue Sep 3 22:43:04 2013 +0000 test/lib_read_write: account for larger-than-normal pipes Linux pipe buffers may use larger pages and increase the capacity of pipes. Thus the 10000 write attempt is not sufficient; just infinite loop until we hit :wait_writable. commit dae148a9d6de7501acf8a68218b3e9d2c5ff6ff7 Author: Eric Wong Date: Tue Sep 3 19:35:46 2013 +0000 test_tryopen: skip EACCES test when euid == 0 This fails when the test is run as root (which may be the case of some Ruby installations) or fakeroot (which is the case of Debian build systems). commit 5c99abe6108d8d6a52c07b969afbc556c59b33be Author: Hleb Valoshka <375GNU@Gmail.COM> Date: Sat Aug 24 17:31:42 2013 +0300 Don't dump 20M in case of failure Signed-off-by: Eric Wong commit fc88b648ca5c2ba6c845c357192d7e36f9dedc5c Author: Hleb Valoshka <375GNU@Gmail.COM> Date: Sat Aug 24 16:50:17 2013 +0300 Change prefix of temporary sockets to prevent races Note: this is an incomplete fix and the race can still happen. A proper fix would involve using a temporary directory for each test and placing the Unix socket in there. Signed-off-by: Eric Wong commit 30c12374f8d23f0e635946fc38546820216457bf Author: Eric Wong Date: Fri Aug 16 02:00:21 2013 +0000 accept: more informative exception on unknown family This may help us diagnose issues on strange OSes. commit 9f30805bc4ff65ad4ca0be9dfb26b1a9bdc70c51 Author: Eric Wong Date: Fri Aug 16 01:52:15 2013 +0000 check syscall returns against < 0 instead of == -1 This may help us avoid errors in case of C library bugs, and also results in smaller code: $ ~/linux/scripts/bloat-o-meter before.so after.so add/remove: 0/0 grow/shrink: 0/9 up/down: 0/-66 (-66) function old new delta s_trywrite 160 159 -1 kgio_write 160 159 -1 kgio_trywrite 160 159 -1 my_recv 616 610 -6 my_peek 616 610 -6 stream_connect 456 448 -8 my_socket 222 213 -9 my_writev 1703 1687 -16 write_check 427 409 -18