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.