Skip to content

[improve] [pip] PIP-375 Expose the Admin client configs: readTimeout, requestTimeout, and connectionTimeout #23222

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions pip/pip-375.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# PIP-375: Expose the Admin client configs: readTimeout, requestTimeout, connectionTimeout

# Background knowledge

- `pulsar-admin sinks create` will upload files to brokers, but if the file is large and the network is slow, it may cost a long time.
- The default value of `requestTimeout` of Admin API is `60s`, after the fix https://github.com/apache/pulsar/pull/23128, it was changed to `300s`.

# Motivation

We'd better to expose the following configs to users:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to update this information in the PIP document.


```properties
# The value is the timeout to build a connection to the server. Value 0 represents infinity. Negative values are not allowed.
connectionTimeout

# The value is the timeout to read a response. If the server doesn't respond within the defined timeframe, ProcessingException is thrown with TimeoutException as a cause.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible that the server responds, but the client just doesn't know about this? 🤔
What if the server responds, but the response isn't fully received by the client?
Is "response timeout" different from "read timeout"?
Could we improve the definition to reduce the confusion?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to have clear descriptions for the settings. You could use GitHub Copilot to revisit the comment based on the feedback to assist in coming up with an improvement.

Value 0 represents infinity. Negative values are not allowed.
readTimeout

# Request time out in seconds for the pulsar admin client for any request, it includes building connections, sending requests, and reading responses.
requestTimeout
```

# Goals

Expose the Admin client configs: `readTimeout`, `requestTimeout` and `connectionTimeout` to users.

# Detailed Design

### Configuration

**broker.conf**
```properties
# The value is used for the brokers' internal pulsar admin client, which means the timeout to read a response. If the server doesn't respond within the defined timeframe, ProcessingException is thrown with TimeoutException as a cause.
Value 0 represents infinity. Negative values are not allowed.
brokerAdminReadTimeoutInSeconds=60
# The value is used for the brokers' internal pulsar admin client, which means request time out in seconds for the pulsar admin client for any request, it includes building connections, sending requests, and reading responses.
brokerAdminRequestTimeoutInSeconds=300
# The value is used for the brokers' internal pulsar admin client, which means the timeout to build a connection to the server. Value 0 represents infinity. Negative values are not allowed.
brokerAdminConnectionTimeoutInSeconds=10
```

### CLI

**client.conf**
```properties
# The value is used for the pulsar admin client, which means the timeout to read a response. If the server doesn't respond within the defined timeframe, ProcessingException is thrown with TimeoutException as a cause.
Value 0 represents infinity. Negative values are not allowed.
adminReadTimeoutInSeconds=60
# The value is used for the pulsar admin client, which means request time out in seconds for the pulsar admin client for any request, it includes building connections, sending requests, and reading responses.
adminRequestTimeoutInSeconds=300
# The value is used for the pulsar admin client, which means the timeout to build a connection to the server. Value 0 represents infinity. Negative values are not allowed.
adminConnectionTimeoutInSeconds=10
```

# Links
* Mailing List discussion thread: https://lists.apache.org/thread/nwvc1jc29k0hnvtn6qtpdyb8b5xp3ch7
* Mailing List voting thread: https://lists.apache.org/thread/2bmzvv7hyfnb2kf6jsgmgjtrjz23qhj2
Loading