Skip to content

Switch to NIO[2] #11

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

Closed
michaelklishin opened this issue Oct 8, 2013 · 9 comments
Closed

Switch to NIO[2] #11

michaelklishin opened this issue Oct 8, 2013 · 9 comments
Assignees
Milestone

Comments

@michaelklishin
Copy link
Contributor

Reported and discussed in some depth on rabbitmq-discuss.

Internal bug tracker: #23327.

The only solution is switching to NIO. NIO would yield little improvement for the client the way it works today but worth moving to for this issue.

@michaelklishin michaelklishin changed the title Socket writes provide no way of specifying a timeout JDK socket writes provide no way of specifying a timeout Feb 18, 2015
@michaelklishin michaelklishin changed the title JDK socket writes provide no way of specifying a timeout Switch to NIO[2] Aug 24, 2016
@arunvisw
Copy link

did we get this feature in?

@michaelklishin
Copy link
Contributor Author

@arunvisw we close issues that are fixed or no longer relevant for other reasons. This one is not closed ;)

@arunvisw
Copy link

Would really appreciate if you can suggest some work arounds

@michaelklishin
Copy link
Contributor Author

The original thread mentions a workaround.

@Hronom
Copy link

Hronom commented Aug 31, 2016

I were any progress on solving blocks by timeout?

@michaelklishin
Copy link
Contributor Author

@Hronom I don't understand what "blocks by timeout" means but there is no way to avoid Socket#write blocking in some cases without a really ugly workaround provided in a thread linked above. The right thing to do is to switch to NIO and since this issue is open, that is not done.

@Hronom
Copy link

Hronom commented Aug 31, 2016

So switching to NIO helps to solve situation when Channel#basicPublish block thread where it called without any notification about that connection slowed down by flow state?

@michaelklishin
Copy link
Contributor Author

@Hronom please get familiar with the original mailing list report. This has no relation to internal flow control (or generally speaking, flow control period). While flow control may make this more visible, it can be reproduced without flow control.

@michaelklishin
Copy link
Contributor Author

We believe the original issue is addressed in #191 but we'll keep this issue open because switching to NIO is still something we are interested in.

acogoluegnes added a commit that referenced this issue Sep 7, 2016
acogoluegnes added a commit that referenced this issue Sep 8, 2016
acogoluegnes added a commit that referenced this issue Sep 8, 2016
acogoluegnes added a commit that referenced this issue Sep 8, 2016
acogoluegnes added a commit that referenced this issue Sep 8, 2016
The current limit may be arbitrary right now (depends on the hardware
and the scenario).

Write as much as possible in the ByteBuffer before clearing it.

Fixes #11
acogoluegnes added a commit that referenced this issue Sep 9, 2016
acogoluegnes added a commit that referenced this issue Sep 9, 2016
acogoluegnes added a commit that referenced this issue Sep 9, 2016
Limit also written frames to the (snapshot) size when iteration starts (instead of
unqueuing during writing).

Fixes #11
acogoluegnes added a commit that referenced this issue Sep 12, 2016
acogoluegnes added a commit that referenced this issue Sep 12, 2016
acogoluegnes added a commit that referenced this issue Sep 13, 2016
Use NIO by default (except in SSLTests).

Fixes #11
acogoluegnes added a commit that referenced this issue Sep 13, 2016
Fixes #11
acogoluegnes added a commit that referenced this issue Sep 14, 2016
And set number of NIO threads a parameter.

Fixes #11
acogoluegnes added a commit that referenced this issue Sep 15, 2016
acogoluegnes added a commit that referenced this issue Sep 15, 2016
Allows to properly handle the first send header request.

Fixes #11
acogoluegnes added a commit that referenced this issue Sep 19, 2016
First draft.

Fixes #11
acogoluegnes added a commit that referenced this issue Sep 19, 2016
Using ByteBuffer-based streams, to avoid duplicating
the frame parsing/write logic.

Fixes #11
acogoluegnes added a commit that referenced this issue Sep 20, 2016
acogoluegnes added a commit that referenced this issue Sep 20, 2016
acogoluegnes added a commit that referenced this issue Sep 21, 2016
acogoluegnes added a commit that referenced this issue Sep 21, 2016
acogoluegnes added a commit that referenced this issue Sep 22, 2016
Clean some unused code, handle connection and TLS handshake failure,
add configuration hook for SocketChannel, create 'use*' methods
to activate NIO or blocking IO.

Fixes #11
acogoluegnes added a commit that referenced this issue Sep 22, 2016
acogoluegnes added a commit that referenced this issue Sep 26, 2016
acogoluegnes added a commit that referenced this issue Sep 28, 2016
acogoluegnes added a commit that referenced this issue Sep 29, 2016
acogoluegnes added a commit that referenced this issue Sep 30, 2016
acogoluegnes added a commit that referenced this issue Sep 30, 2016
acogoluegnes added a commit that referenced this issue Oct 3, 2016
This test was initially created to reproduce a transient
error during the TLS handshake. It looks like this issue
was related to Erlang, introduced in 19.x and fixed in 19.1.1
(http://erlang.org/download/OTP-19.1.1.README).

Fixes #11
acogoluegnes added a commit that referenced this issue Oct 4, 2016
The ExecutorService wasn't closed properly in the base test
class, there were thus many threads in park state when running
the test suite. This could lead to resource exhaustion, especially
on MacOS.

Fixes #11
acogoluegnes added a commit that referenced this issue Oct 5, 2016
On MacOS, SocketChannel.read() can return EOF when the SocketChannel
is closed. On Linux, it would throw an exception. This could lead
to spinning threads on MacOS, because the NIO loop was never closed.

Fixes #11
acogoluegnes added a commit that referenced this issue Oct 5, 2016
The default is to use blocking IO.

Fixes #11
acogoluegnes added a commit that referenced this issue Oct 5, 2016
And change EOF message, to make it clearer.

Fixes #11
@michaelklishin michaelklishin added this to the 4.0.0 milestone Oct 5, 2016
acogoluegnes added a commit that referenced this issue Oct 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants