socketry / async-redis

MIT License
83 stars 18 forks source link

EOFError test fails on JRuby #13

Closed davidor closed 5 years ago

davidor commented 5 years ago

There's one test that fails under JRuby: Async::Redis::Client should raise EOFError on unexpected disconnect. See the Travis job for PR #11 https://travis-ci.org/socketry/async-redis/jobs/501174074

ioquatix commented 5 years ago

I think we are hitting a bug on our end because we are closing the socket twice.

                stream = Async::IO::Stream.new(connection)
                stream.read(8)
                stream.close
                connection.close

stream.close also closes the underlying connection.

Can you try removing connection.close? I think it should fix the test failure.

ioquatix commented 5 years ago

https://github.com/socketry/async-io/blob/master/lib/async/io/stream.rb#L166-L178

davidor commented 5 years ago

You're right, that connection.close should not be necessary. However, deleting that call does not fix the issue: https://github.com/socketry/async-redis/pull/14

I'll try to find some time to find the root cause tomorrow.

ioquatix commented 5 years ago

Fixed.