Skip to content
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

Setting async timeout on WebSocketClient does not seem to timeout writes #847

Closed
eoghanoh1 opened this issue Aug 16, 2016 · 4 comments
Closed
Assignees

Comments

@eoghanoh1
Copy link

Version: Jetty 9.3.6.

I am using jetty web socket native web socket implementation (not JSR-356).

I enabled the async write timeout on WebSocketClient to be greater than the max idle timeout. Looking through the Jetty code, it looks like the async write timeout is required to be larger than max idle (makes sense to me).

I ran the following test;

  1. plug network cable out of client machine
  2. attempt to send data over the web socket via either;
    a) RemoteEndpoint.sendString(String data) [* blocking]
    b) RemoteEndpoint.sendString(String data, WriteCallback callback)
    c) RemoteEndpoint.sendStringByFuture(String data)

With a);
The web socket closes after ~19 seconds.

With b);
I get a writeSuccess callback invoked, even though the data could not have been sent. I would not have expected this, since the data could not be sent. Is this callback for the status of the write to the queue rather than actually transmission of the data?
The web socket closes after ~19 seconds.

With c);
The web socket closes after ~19 seconds.

For the two async send API's above (b & c), I would have expected that the write for sending the data (@ point 2) would timeout once the async write timeout is exceeded.

Is this an incorrect assumption, if so can you give an overview as to what the async write timeout is for? Also could you advise me how or if I can configure Jetty to timeout sending data after a defined timeout.

@stale
Copy link

stale bot commented Nov 20, 2019

This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale For auto-closed stale issues and pull requests label Nov 20, 2019
@joakime joakime removed the Stale For auto-closed stale issues and pull requests label Nov 20, 2019
@joakime
Copy link
Contributor

joakime commented Nov 20, 2019

@lachlan-roberts have you verified the behaviors documented by the OP on Jetty 10?

@lachlan-roberts
Copy link
Contributor

@joakime this is implemented in Jetty 10 but not in Jetty 9.4, we seem to have setters for it in various places in 9.4 but it doesn't look like the setting is used.

Should I look at bringing this into 9.4.x or it is only a feature for Jetty 10?

@lachlan-roberts
Copy link
Contributor

I will also need to add the writeTimeout to the WebSocketPolicy for jetty-10, it is only available through the core and javax APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants