yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
* [PATCH] worker: workaround old F_SETPIPE_SZ bug
@ 2019-05-04 16:34 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2019-05-04 16:34 UTC (permalink / raw)
  To: yahns-public

Linux before 4.9 (and before 3.16.57) failed to account
for the existing size of a pipe before checking system
resource limits and would return EPERM in that case.


Based on a patch by Stephen Demjanenko for unicorn:
 lib/yahns/worker.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/yahns/worker.rb b/lib/yahns/worker.rb
index 0355629..ec5be23 100644
--- a/lib/yahns/worker.rb
+++ b/lib/yahns/worker.rb
@@ -14,8 +14,8 @@ def initialize(nr)
       # F_SETPIPE_SZ = 1031, PAGE_SIZE = 4096
       # (fcntl will handle minimum size on platforms where PAGE_SIZE > 4096)
       @to_io.fcntl(1031, 4096)
-    rescue Errno::EINVAL
-      # old kernel
+    rescue SystemCallError
+      # old kernel (EINVAL, EPERM)
     end if RUBY_PLATFORM =~ /\blinux\b/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-04 16:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-04 16:34 [PATCH] worker: workaround old F_SETPIPE_SZ bug Eric Wong

yahns Ruby server user/dev discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhbt.net/yahns-public
	git clone --mirror http://ou63pmih66umazou.onion/yahns-public

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 yahns-public yahns-public/ https://yhbt.net/yahns-public \
		yahns-public@yhbt.net yahns-public@rubyforge.org
	public-inbox-index yahns-public

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:


AGPL code for this site: git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/public-inbox.git