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

duplicated create Eureka-JerseyClient-Con-Cleaner task and remove all JerseyClient-Connection #1041

Closed
chendurex opened this issue Mar 9, 2018 · 1 comment
Labels

Comments

@chendurex
Copy link

version:eureka-client is 1.8.6

duplicated Eureka-JerseyClient-Con-Cleaner task bug description:when create Eureka-JerseyClient-Con-Cleaner task at com.netflix.discovery.shared.transport.jersey.JerseyEurekaHttpClientFactory class and buildLegacy method. (the code like bellow)the method created two cleaner task ,one at EurekaJerseyClient jerseyClient = clientBuilder.build(), and other at new JerseyEurekaHttpClientFactory(jerseyClient, additionalHeaders);

private JerseyEurekaHttpClientFactory buildLegacy(Map<String, String> additionalHeaders, boolean systemSSL) {
            EurekaJerseyClientBuilder clientBuilder = new EurekaJerseyClientBuilder()
                    .withClientName(clientName)
                    .withUserAgent("Java-EurekaClient")
                    .withConnectionTimeout(connectionTimeout)
                    .withReadTimeout(readTimeout)
                    .withMaxConnectionsPerHost(maxConnectionsPerHost)
                    .withMaxTotalConnections(maxTotalConnections)
                    .withConnectionIdleTimeout((int) connectionIdleTimeout)
                    .withEncoderWrapper(encoderWrapper)
                    .withDecoderWrapper(decoderWrapper);

            if (systemSSL) {
                clientBuilder.withSystemSSLConfiguration();
            } else if (sslContext != null) {
                clientBuilder.withCustomSSL(sslContext);
            }
            
            if (hostnameVerifier != null) {
                clientBuilder.withHostnameVerifier(hostnameVerifier);
            }

            EurekaJerseyClient jerseyClient = clientBuilder.build();
            ApacheHttpClient4 discoveryApacheClient = jerseyClient.getClient();
            addFilters(discoveryApacheClient);

            return new JerseyEurekaHttpClientFactory(jerseyClient, additionalHeaders);
        }

remove all JerseyClient-Connection bug description:like above bug description,the new JerseyEurekaHttpClientFactory(jerseyClient, additionalHeaders); should add connectionIdleTimeout param,but actually not,and then remove all JerseyClient-Connection when Eureka-JerseyClient-Con-Cleaner task begin running,the cleaner log like bellow:

2018-03-09 10:00:12.095,[thread]:[Eureka-JerseyClient-Conn-Cleaner2],[level]:DEBUG,[class]:com.netflix.discovery.shared.MonitoredConnectionManager.closeIdleConnections 332 - Closing connections idle longer than -1 SECONDS
@qiangdavidliu
Copy link
Contributor

@chendurex thank you for the report, this does look to be the case. We will take a look at this.

qiangdavidliu added a commit to qiangdavidliu/eureka that referenced this issue Apr 24, 2018
qiangdavidliu added a commit that referenced this issue Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants