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

Socket leak when using Webclient #25326

Closed
fanticat opened this issue Jun 29, 2020 · 2 comments
Closed

Socket leak when using Webclient #25326

fanticat opened this issue Jun 29, 2020 · 2 comments
Labels
status: duplicate A duplicate of another issue

Comments

@fanticat
Copy link

fanticat commented Jun 29, 2020

Spring Boot Version: 2.3.1, when 2.3.0 has no problem
When using a sample Webclient to retrive a remote restful API, this happens.

The test code:

@RestController
@Slf4j
public class WebClientController {

    @Autowired
    private WebClient.Builder webClientBuilder;

    @PostMapping(value = "/wb")
    public Mono<String> wbTest(@PathVariable(required = false) String action) {
        return webClientBuilder.build().get().uri("http://remoteIP:remotePort/privaters/jwks/pub")
                .retrieve()
                .bodyToMono(String.class);
    }

}

After a few requsts, using lsof -p XXX to check, then shows scokets leaked!

java    10823 ircp   32u     sock                0,7       0t0 154700740 protocol: TCP
java    10823 ircp   33u     sock                0,7       0t0 154701211 protocol: TCP
java    10823 ircp   34u     sock                0,7       0t0 154700776 protocol: TCP
java    10823 ircp   35u     sock                0,7       0t0 154700777 protocol: TCP
java    10823 ircp   36u     sock                0,7       0t0 154700778 protocol: TCP
java    10823 ircp   37u     sock                0,7       0t0 154701301 protocol: TCP
java    10823 ircp   38u     sock                0,7       0t0 154701304 protocol: TCP
java    10823 ircp   39u     sock                0,7       0t0 154701307 protocol: TCP
java    10823 ircp   40u     sock                0,7       0t0 154701837 protocol: TCP
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 29, 2020
@bclozel
Copy link
Member

bclozel commented Jun 29, 2020

I think this is a duplicate of spring-projects/spring-boot#22091 and spring-projects/spring-boot#21923
This was an issue in Reactor Netty. You can work around this problem by upgrading to Reactor Dysprosium-SR9 (or wait for spring-projects/spring-boot#21938 if you're using Spring Boot).

Thanks for your report!

@bclozel bclozel closed this as completed Jun 29, 2020
@bclozel bclozel added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 29, 2020
@fanticat
Copy link
Author

@bclozel Thanks for your feedback,I have degrade the Spring Boot to V2.3.0 as temporary solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants