Skip to content

Undertow connection timeout is set incorrectly #15797

@jan-krakora

Description

@jan-krakora

Spring Boot version: 2.1.1
Undertow version: 2.0.16 (Spring Boot's managed dependency)

Setting

server
    connection-timeout: whatever

then the autoconfiguration class UndertowWebServerFactoryCustomizer sets this property as socket option

builder.setSocketOption(UndertowOptions.NO_REQUEST_TIMEOUT, (int) connectionTimeout.toMillis())

This is ignored by Undertow since this property is expected to be set in server options. Therefore it should be

builder.setServerOption(UndertowOptions.NO_REQUEST_TIMEOUT, (int) connectionTimeout.toMillis())

see Undertow#start() where is merged a default value for this option with all options set in the builder.

OptionMap serverOptions = OptionMap.builder()
                    .set(UndertowOptions.NO_REQUEST_TIMEOUT, 60 * 1000)
                    .addAll(this.serverOptions)
                    .getMap();

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by anothertype: bugA general bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions