-
Notifications
You must be signed in to change notification settings - Fork 643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unix Domain Socket - ensure that interest in READ is removed upon EOF #1056
Conversation
@@ -312,7 +312,7 @@ object Dependencies { | |||
|
|||
val UnixDomainSocket = Seq( | |||
libraryDependencies ++= Seq( | |||
"com.github.jnr" % "jnr-unixsocket" % "0.18" // BSD/ApacheV2/CPL/MIT as per https://github.com/akka/alpakka/issues/620#issuecomment-348727265 | |||
"com.github.jnr" % "jnr-unixsocket" % "0.19" // BSD/ApacheV2/CPL/MIT as per https://github.com/akka/alpakka/issues/620#issuecomment-348727265 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What’s the fix they made? I’m wondering if they fixed a native buffer issue, in which case perhaps an alternate PR for this with consideration of using native buffers. There’s a FixMe somewhere in this code with a ref to the bug...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Socket options weren't set correctly -- i.e. big endian was always used. This would cause buffer sizes to be quite wrong on intel arch: jnr/jnr-unixsocket@aa2c1e4
jnr/jnr-unixsocket#48 is still open though.
@@ -170,6 +170,7 @@ object UnixDomainSocket extends ExtensionId[UnixDomainSocket] with ExtensionIdPr | |||
sendReceiveContext.receive = PendingReceiveAck(queue, buffer, pendingResult) | |||
key.interestOps(key.interestOps() & ~SelectionKey.OP_READ) | |||
} else { | |||
key.interestOps(key.interestOps() & ~SelectionKey.OP_READ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can now move outside the conditional block given that both conditions remove the subscription.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, moving it outside the conditional would be good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved!
Got it. Thanks.
… On 30 Jun 2018, at 07:11, Jason Longshore ***@***.***> wrote:
@longshorej commented on this pull request.
In project/Dependencies.scala:
> @@ -312,7 +312,7 @@ object Dependencies {
val UnixDomainSocket = Seq(
libraryDependencies ++= Seq(
- "com.github.jnr" % "jnr-unixsocket" % "0.18" // BSD/ApacheV2/CPL/MIT as per #620 (comment)
+ "com.github.jnr" % "jnr-unixsocket" % "0.19" // BSD/ApacheV2/CPL/MIT as per #620 (comment)
Socket options weren't set correctly -- i.e. big endian was always used. This would cause buffer sizes to be quite wrong on intel arch: ***@***.***
jnr/jnr-unixsocket#48 is still open though.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one nitpick.
235f238
to
5932b0c
Compare
5932b0c
to
6977572
Compare
Thank you, good to see the nifty details fixed. |
Fixes an issue observed with unix domain socket connector where when the read side was closed, the NIO event loop would go into an infinite loop with
channel.read
returning-1
.We should have be deregistering interest in
READ
when completing the queue.Related PR: #878
/cc @huntc