unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Sam Saffron <sam.saffron@gmail.com>
To: unicorn-public <unicorn-public@bogomips.org>, Eric Wong <e@80x24.org>
Subject: KGIO issues under WSL
Date: Tue, 14 Aug 2018 12:05:33 +1000	[thread overview]
Message-ID: <CAAtdryOtTO8HGTeKLy_JbeRhWLC7JZpCABVpbpEK+z67JHx=ew@mail.gmail.com> (raw)

Howdy,

For some crazy reason we really want to run Unicorn on Windows
Subsytem for Linux. We only use Unicorn in production and some of our
devs like using WSL for "crazy reasons TM".

I guess the on-boarding is somewhat easier for Windows users vs
spinning up a proper VM.

WSL overall works fine but is missing some socket options that mean
Kgio is toast and you can not accept sockets.

linking shared-object kgio_ext.so
make[1]: Leaving directory '/home/sam/kgio/tmp/ext/ruby-2.5.1/ext/kgio'
ruby -I lib:tmp/ext/ruby-2.5.1/ext/kgio test/test_autopush.rb
Loaded suite test/test_autopush
Started
E
=====================================================================================================================================================================================================================================================================================
test/test_autopush.rb:32:in `test_autopush_accessors'
     29:     Kgio.autopush = true
     30:     opt = RUBY_PLATFORM =~ /freebsd/ ? TCP_NOPUSH : TCP_CORK
     31:     s = Kgio::TCPSocket.new(@host, @port)
  => 32:     assert_equal 0, s.getsockopt(Socket::IPPROTO_TCP,
opt).unpack('i')[0]
     33:     assert ! s.kgio_autopush?
     34:     s.kgio_autopush = true
     35:     assert s.kgio_autopush?
test/test_autopush.rb:32:in `getsockopt'
Error: test_autopush_accessors(TestAutopush): Errno::ENOPROTOOPT:
Protocol not available - getsockopt(2)
=====================================================================================================================================================================================================================================================================================
F
=====================================================================================================================================================================================================================================================================================
test/test_autopush.rb:97:in `test_autopush_false'
      94:     @rd.kgio_write "HI\n"
      95:     @wr.kgio_read(3, rbuf)
      96:     diff = Time.now - t0
  =>  97:     assert(diff >= 0.190, "nopush broken? diff=#{diff} > 200ms")
      98:     assert_equal "HI\n", rbuf
      99:   end
     100:
Failure: test_autopush_false(TestAutopush):
  nopush broken? diff=5.68e-05 > 200ms.
  <false> is not true.
=====================================================================================================================================================================================================================================================================================
E
=====================================================================================================================================================================================================================================================================================
test/test_autopush.rb:113:in `test_autopush_true'
     110:       assert_equal 1, lines.grep(/TCP_CORK/).size, lines.inspect
     111:       assert_equal 1, @rd.getsockopt(Socket::SOL_TCP,
TCP_CORK).unpack("i")[0]
     112:     else
  => 113:       @rd = @srv.kgio_accept
     114:     end
     115:
     116:     @wr.write "HI\n"
test/test_autopush.rb:113:in `kgio_accept'
Error: test_autopush_true(TestAutopush): Errno::ENOPROTOOPT: Protocol
not available - getsockopt(TCP_CORK/TCP_NOPUSH)
=====================================================================================================================================================================================================================================================================================
E
=====================================================================================================================================================================================================================================================================================
test/test_autopush.rb:64:in `test_autopush_true_unix'
     61:       lines = io.readlines
     62:       assert lines.grep(/TCP_CORK/).empty?, lines.inspect
     63:     else
  => 64:       @wr = @srv.kgio_accept
     65:       t0 = Time.now
     66:       @wr.kgio_write "HI\n"
     67:       rc = @wr.kgio_tryread 666
test/test_autopush.rb:64:in `kgio_accept'
Error: test_autopush_true_unix(TestAutopush): Errno::EINVAL: Invalid
argument - getsockopt(TCP_CORK/TCP_NOPUSH)
=====================================================================================================================================================================================================================================================================================

Finished in 0.0209615 seconds.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
4 tests, 7 assertions, 1 failures, 3 errors, 0 pendings, 0 omissions,
0 notifications
0% passed
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
190.83 tests/s, 333.95 assertions/s
pkg.mk:122: recipe for target 'test/test_autopush.rb' failed
make: *** [test/test_autopush.rb] Error 1
sam@sams-pc:~/kgio$


I was thinking since we are going to be giving up kgio longer term
anyway, is there a way of having some flag for running unicorn without
kgio or maybe even with minimal socket options given setsockoptions
and getsockoptions are patchy. A monkey patch would be fine a well
cause this is just for development and Puma seems to be ok-ish.

             reply	other threads:[~2018-08-14  2:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14  2:05 Sam Saffron [this message]
2018-08-14  3:14 ` KGIO issues under WSL Eric Wong

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-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAtdryOtTO8HGTeKLy_JbeRhWLC7JZpCABVpbpEK+z67JHx=ew@mail.gmail.com' \
    --to=sam.saffron@gmail.com \
    --cc=e@80x24.org \
    --cc=unicorn-public@bogomips.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.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

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).