You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "nodece (via GitHub)" <gi...@apache.org> on 2026/02/06 11:00:28 UTC
[PR] [improve][broker] Add idle timeout support for http [pulsar]
nodece opened a new pull request, #25224:
URL: https://github.com/apache/pulsar/pull/25224
### Motivation
When uploading a large package through the Pulsar proxy, the default idle timeout is too short to accommodate the duration of the upload. As a result, the HTTP client triggers a timeout, causing the upload to fail and returning a 504 Gateway Timeout to the user. This behavior is illustrated by the following logs:
```
2026-02-06T07:14:57,181+0000 [JettyHttpClient@22d8f4ed-scheduler-1] DEBUG org.eclipse.jetty.client.HttpReceiver - Request/Response failed: Result[HttpRequest[POST /admin/v3/packages/function/public/default/test-pkg-2/7.0 HTTP/1.1]@363b647f > HttpResponse[null 0 null]@26b34803] java.util.concurrent.TimeoutException: Idle timeout 30000 ms, notifying [org.eclipse.jetty.proxy.ProxyServlet$ProxyResponseListener@4fc68ea1]
2026-02-06T07:14:57,181+0000 [JettyHttpClient@22d8f4ed-scheduler-1] DEBUG org.apache.pulsar.proxy.server.AdminProxyHandler.15400fff - 38844857 proxying failed
java.util.concurrent.TimeoutException: Idle timeout 30000 ms
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onIdleExpired(HttpConnectionOverHTTP.java:160) ~[org.eclipse.jetty-jetty-client-9.4.54.v20240208.jar:9.4.54.v20240208]
at org.eclipse.jetty.io.AbstractEndPoint.onIdleExpired(AbstractEndPoint.java:402) ~[org.eclipse.jetty-jetty-io-9.4.54.v20240208.jar:9.4.54.v20240208]
at org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:171) ~[org.eclipse.jetty-jetty-io-9.4.54.v20240208.jar:9.4.54.v20240208]
at org.eclipse.jetty.io.IdleTimeout.idleCheck(IdleTimeout.java:113) ~[org.eclipse.jetty-jetty-io-9.4.54.v20240208.jar:9.4.54.v20240208]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:?]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
at java.lang.Thread.run(Unknown Source) ~[?:?]
```
### Modifications
- Add `httpServerIdleTimeout` to the broker config
- Add `httpIdleTimeout` and `httpProxyIdleTimeout` to the proxy config
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][broker] Add idle timeout support for http [pulsar]
Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece commented on code in PR #25224:
URL: https://github.com/apache/pulsar/pull/25224#discussion_r2773908271
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -347,6 +347,12 @@ public class ServiceConfiguration implements PulsarConfiguration {
)
private int httpServerAcceptQueueSize = 8192;
+ @FieldContext(
+ category = CATEGORY_HTTP,
+ doc = "Idle timeout for HTTP server connections in milliseconds."
+ )
+ private int httpServerIdleTimeout = 30 * 1000;
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][broker] Add idle timeout support for http [pulsar]
Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece commented on code in PR #25224:
URL: https://github.com/apache/pulsar/pull/25224#discussion_r2773907447
##########
pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java:
##########
@@ -808,6 +808,22 @@ public class ProxyConfiguration implements PulsarConfiguration {
)
private int httpProxyTimeout = 5 * 60 * 1000;
+ @FieldContext(
+ minValue = 0,
+ category = CATEGORY_HTTP,
+ doc = "Http idle timeout.\n\n"
+ + "The idle timeout value for HTTP is in millisecond."
+ )
+ private int httpIdleTimeout = 30 * 1000;
+
+ @FieldContext(
+ minValue = 0,
+ category = CATEGORY_HTTP,
+ doc = "Http proxy idle timeout.\n\n"
+ + "The idle timeout value for HTTP proxy is in millisecond."
+ )
+ private int httpProxyIdleTimeout = 30 * 1000;
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][broker] Add idle timeout support for http [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #25224:
URL: https://github.com/apache/pulsar/pull/25224#discussion_r2773656827
##########
pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java:
##########
@@ -808,6 +808,22 @@ public class ProxyConfiguration implements PulsarConfiguration {
)
private int httpProxyTimeout = 5 * 60 * 1000;
+ @FieldContext(
+ minValue = 0,
+ category = CATEGORY_HTTP,
+ doc = "Http idle timeout.\n\n"
+ + "The idle timeout value for HTTP is in millisecond."
+ )
+ private int httpIdleTimeout = 30 * 1000;
+
+ @FieldContext(
+ minValue = 0,
+ category = CATEGORY_HTTP,
+ doc = "Http proxy idle timeout.\n\n"
+ + "The idle timeout value for HTTP proxy is in millisecond."
+ )
+ private int httpProxyIdleTimeout = 30 * 1000;
Review Comment:
please add these keys to `proxy.conf`
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -347,6 +347,12 @@ public class ServiceConfiguration implements PulsarConfiguration {
)
private int httpServerAcceptQueueSize = 8192;
+ @FieldContext(
+ category = CATEGORY_HTTP,
+ doc = "Idle timeout for HTTP server connections in milliseconds."
+ )
+ private int httpServerIdleTimeout = 30 * 1000;
Review Comment:
please add this key to `broker.conf` and `standalone.conf` too
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][broker] Add idle timeout support for http [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #25224:
URL: https://github.com/apache/pulsar/pull/25224
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][broker] Add idle timeout support for http [pulsar]
Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece commented on PR #25224:
URL: https://github.com/apache/pulsar/pull/25224#issuecomment-3860210117
This PR has been updated to unify the `httpServerIdleTimeout` configuration for both the proxy and broker, with the key added to each component's config file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org