Skip to content

[fix][admin] Use ClientConfigurationData timeout params to set AsyncHttpConnector timeout params#11

Open
oneby-wang wants to merge 7 commits into
masterfrom
pulsar_admin_timeout_params
Open

[fix][admin] Use ClientConfigurationData timeout params to set AsyncHttpConnector timeout params#11
oneby-wang wants to merge 7 commits into
masterfrom
pulsar_admin_timeout_params

Conversation

@oneby-wang

@oneby-wang oneby-wang commented Dec 4, 2025

Copy link
Copy Markdown
Owner

Motivation

In previous code, we use client.getConfiguration().getProperty(ClientProperties.CONNECT_TIMEOUT) as PulsarAdmin's connectionTimeoutMs, use client.getConfiguration().getProperty(ClientProperties.READ_TIMEOUT) as PulsarAdmin's readTimeoutMs, use PulsarAdminImpl.DEFAULT_REQUEST_TIMEOUT_SECONDS * 1000 as PulsarAdmin's requestTimeoutMs. See:

https://github.com/apache/pulsar/blob/b71bea4c42353f9d14f817aa9a0877d495336f34/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/http/AsyncHttpConnector.java#L121-L128

Before this PR, we can't tune requestTimeoutMs, which is always 30000s = 5min. See also in:

apache#24879 (comment)

Modifications

Now, we use ClientConfigurationData.requestTimeoutMs as AsyncHttpConnector.requestTimeoutMs , so we can control the http retry timeout by tuning ClientConfigurationData.requestTimeoutMs.

AsyncHttpClient get Connector by calling ConnectorProvider#getConnector(Client client, Configuration runtimeConfig) method.

https://github.com/eclipse-ee4j/jersey/blob/bb8a2a1b78e39604f4d283d0176705b143355cce/core-client/src/main/java/org/glassfish/jersey/client/ClientConfig.java#L465-L467

Both connectionTimeoutMs and readTimeoutMs are the same values in jersey properties and ClientConfigurationData. See:

https://github.com/apache/pulsar/blob/b71bea4c42353f9d14f817aa9a0877d495336f34/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/PulsarAdminImpl.java#L146-L150

To ensure code consistency, I would like to suggest using ClientConfigurationData and removing jersey config.

Side effect: default requestTimeoutMs changes from 30s to 60s after this PR, which I think is reasonable. If I didn't read the source code, I would assume requestTimeoutMs is set to 60s, and it would confuse me to find that requestTimeoutMs didn't take effect after I adjusted this value.

Verifying this change

  • Make sure that the change passes the CI checks.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@oneby-wang oneby-wang force-pushed the pulsar_admin_timeout_params branch from bc8f13f to 2d221a7 Compare January 20, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant