rabbitmq / rabbitmq-server

Open source RabbitMQ: core server and tier 1 (built-in) plugins
https://www.rabbitmq.com/
Other
12.27k stars 3.91k forks source link

Unsuccessfully trying to configure a TCP connection timeout for the HTTP API #12170

Closed alphamonkey79 closed 2 months ago

alphamonkey79 commented 2 months ago

Describe the bug

Adding http connect_timeout and timeout parameters to rabbitmq.config fails to update from default values. /var/appl/logs/payx/rabldap/rabldap.out 2024-08-28 15:15:17.246106-04:00 [debug] <0.5935.0> auth_backend_http: request timeout: 15000, connection timeout: 15000 2024-08-28 15:15:17.262451-04:00 [debug] <0.5935.0> auth_backend_http: request timeout: 15000, connection timeout: 15000

Reproduction steps

  1. Add parameters 'timeout' and 'connect_timeout' to rabbitmq.config
  2. Restart rabbitmq server ...

Expected behavior

we are expecting the timeouts to not see anymore timeouts

Additional context

Add configurable timeout to HTTP connections #3140

michaelklishin commented 2 months ago

These settings do not apply to the HTTP API. They apply to AMQP 0-9-1 and AMQP 1.0 (other protocols have their own similar settings).

For HTTP API settings, see Advanced HTTP Options.

alphamonkey79 commented 2 months ago

found the problem... per rabbitmq_auth_backend_http.schema the param names are 'request_timeout' and 'connection_timeout'

michaelklishin commented 2 months ago

@alphamonkey79 there are multiple timeouts available, https://www.rabbitmq.com/docs/management#advanced-options covers the key ones.

gomoripeti commented 2 months ago

just to clarify for people who find this issue later

the original question is about HTTP client configuration (of the http auth backend plugin), not server config (of the management plugin)

indeed the documentation of the http auth backend plugin does not mention timeout configuration. I will submit a PR to add what @alphamonkey79 already found out

to summarise with an example in modern config:

auth_http.connection_timeout=10000
auth_http.request_timeout=20000

same in advanced config format

{rabbitmq_auth_backend_http,
    [{connection_timeout, 10_000},
     {request_timeout, 20_000},
     ...
]}