Affects: \

Looks like FORM request will cause a thread leak. (/prox//task/ ) In spring-web-5.3.0.jar In DefaultServerWebExchange.java: @SuppressWarnings("unchecked") private static Mono> initFormData(ServerHttpRequest request, ServerCodecConfigurer configurer, String logPrefix) {

    try {
        MediaType contentType = request.getHeaders().getContentType();
        if (MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType)) {
            return ((HttpMessageReader<MultiValueMap<String, String>>) configurer.getReaders().stream()
                    .filter(reader -> reader.canRead(FORM_DATA_TYPE, MediaType.APPLICATION_FORM_URLENCODED))
                    .findFirst()
                    .orElseThrow(() -> new IllegalStateException("No form data HttpMessageReader.")))
                    .readMono(FORM_DATA_TYPE, request, Hints.from(Hints.LOG_PREFIX_HINT, logPrefix))
                    .switchIfEmpty(EMPTY_FORM_DATA)
                    .cache();
        }
    }
    catch (InvalidMediaTypeException ex) {
        // Ignore
    }
    return EMPTY_FORM_DATA;
}

when remove those lines, no thread leak occured。

would someone else found the same issue?


Comment From: poutsma

Version 5.3.0 was released October last year. Since then, there have been many changes which might have fixed this problem. Please try again with a recent version (5.3.6 is most recent when I write this), and confirm whether this issue still exists.

Comment From: Leedoo

YES. 5.3.6 do not has this issue. Thanks for your quickly feedback