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

Asssociate timeout to underlying Jetty HTTP client #24007

Closed
wants to merge 6 commits into from
Closed

Asssociate timeout to underlying Jetty HTTP client #24007

wants to merge 6 commits into from

Commits on Nov 14, 2019

  1. Set a timeout in Future<Session>

    In some cases, org.eclipse.jetty.websocket.client.WebSocketClient.connect(listener, uri, request) call will return a future that never is completed. It is reasonable that our future.get() must have a timeout to avoid thread blocking.
    I suggest something like:
    		Callable<WebSocketSession> connectTask = () -> {
    			Future<Session> future = this.client.connect(listener, uri, request);
                            try {
    				// TODO Configurable timeout
    				future.get(2000, TimeUnit.MILLISECONDS);
                            } catch (Exception ex){
                                     logger.error("Failed to connect to remote websocket endpoint", ex);
                                     future.cancel(true); // This method will stop the running underlying task
                            }
    			return wsSession;
    		};
    Kukosoft committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    b5326c1 View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2019

  1. Timeout associated to Jetty client

    Connection timeout is now associated to Jetty client timeout plus 50ms extra padding.
    Kukosoft committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    9f68842 View commit details
    Browse the repository at this point in the history
  2. Jetty idle timeout added to overall timeout

    Timeout must consider also the idle timeout  of the Jetty client
    Kukosoft committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    9c38ea0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8b13866 View commit details
    Browse the repository at this point in the history
  4. Max idle timeout changed

    Change idle Jetty max idle timeout for underlying HTTP Client
    Kukosoft committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    278fcd9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b4f29d1 View commit details
    Browse the repository at this point in the history