Skip to content

Conversation

@lhotari
Copy link
Member

@lhotari lhotari commented Jul 16, 2025

Motivation

The configuration code added in #16165 intends to set the default value of connectionMaxIdleSeconds in Pulsar Proxy to -1. This is not the case. The effective value is 60 since the value is set after the object is no longer used.

/** The proxy service does not need to automatically clean up invalid connections, so set false. **/
initialConf.setConnectionMaxIdleSeconds(-1);

full method code:

ClientConfigurationData createClientConfiguration() {
ClientConfigurationData initialConf = new ClientConfigurationData();
ProxyConfiguration proxyConfig = service.getConfiguration();
initialConf.setServiceUrl(
proxyConfig.isTlsEnabledWithBroker() ? service.getServiceUrlTls() : service.getServiceUrl());
// Apply all arbitrary configuration. This must be called before setting any fields annotated as
// @Secret on the ClientConfigurationData object because of the way they are serialized.
// See https://github.com/apache/pulsar/issues/8509 for more information.
Map<String, Object> overrides = PropertiesUtils
.filterAndMapProperties(proxyConfig.getProperties(), "brokerClient_");
ClientConfigurationData clientConf = ConfigurationDataUtils
.loadData(overrides, initialConf, ClientConfigurationData.class);
/** The proxy service does not need to automatically clean up invalid connections, so set false. **/
initialConf.setConnectionMaxIdleSeconds(-1);
clientConf.setAuthentication(this.getClientAuthentication());
if (proxyConfig.isTlsEnabledWithBroker()) {
clientConf.setUseTls(true);
clientConf.setTlsHostnameVerificationEnable(proxyConfig.isTlsHostnameVerificationEnabled());
if (proxyConfig.isBrokerClientTlsEnabledWithKeyStore()) {
clientConf.setUseKeyStoreTls(true);
clientConf.setTlsTrustStoreType(proxyConfig.getBrokerClientTlsTrustStoreType());
clientConf.setTlsTrustStorePath(proxyConfig.getBrokerClientTlsTrustStore());
clientConf.setTlsTrustStorePassword(proxyConfig.getBrokerClientTlsTrustStorePassword());
clientConf.setTlsKeyStoreType(proxyConfig.getBrokerClientTlsKeyStoreType());
clientConf.setTlsKeyStorePath(proxyConfig.getBrokerClientTlsKeyStore());
clientConf.setTlsKeyStorePassword(proxyConfig.getBrokerClientTlsKeyStorePassword());
} else {
clientConf.setTlsTrustCertsFilePath(proxyConfig.getBrokerClientTrustCertsFilePath());
clientConf.setTlsKeyFilePath(proxyConfig.getBrokerClientKeyFilePath());
clientConf.setTlsCertificateFilePath(proxyConfig.getBrokerClientCertificateFilePath());
}
clientConf.setTlsAllowInsecureConnection(proxyConfig.isTlsAllowInsecureConnection());
}
return clientConf;
}

Modifications

  • move the line of code a few lines earlier so that it gets used
  • add a test

Documentation

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

@lhotari lhotari added this to the 4.1.0 milestone Jul 16, 2025
@lhotari lhotari self-assigned this Jul 16, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jul 16, 2025
@lhotari lhotari requested a review from dao-jun July 16, 2025 18:47
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.27%. Comparing base (bbc6224) to head (24d9fac).
Report is 1197 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24529      +/-   ##
============================================
+ Coverage     73.57%   74.27%   +0.69%     
- Complexity    32624    32860     +236     
============================================
  Files          1877     1868       -9     
  Lines        139502   145941    +6439     
  Branches      15299    16735    +1436     
============================================
+ Hits         102638   108394    +5756     
- Misses        28908    28932      +24     
- Partials       7956     8615     +659     
Flag Coverage Δ
inttests 26.72% <100.00%> (+2.14%) ⬆️
systests 23.32% <100.00%> (-1.01%) ⬇️
unittests 73.75% <100.00%> (+0.91%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rg/apache/pulsar/proxy/server/ProxyConnection.java 54.46% <100.00%> (-4.31%) ⬇️

... and 1097 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nodece nodece merged commit a87d477 into apache:master Jul 17, 2025
54 checks passed
lhotari added a commit that referenced this pull request Jul 17, 2025
lhotari added a commit that referenced this pull request Jul 17, 2025
BewareMyPower pushed a commit that referenced this pull request Jul 17, 2025
priyanshu-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 22, 2025
…Proxy (apache#24529)

(cherry picked from commit a87d477)
(cherry picked from commit a2ba5b8)
priyanshu-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 22, 2025
…Proxy (apache#24529)

(cherry picked from commit a87d477)
(cherry picked from commit 405e51a)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 23, 2025
…Proxy (apache#24529)

(cherry picked from commit a87d477)
(cherry picked from commit a2ba5b8)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 24, 2025
…Proxy (apache#24529)

(cherry picked from commit a87d477)
(cherry picked from commit 405e51a)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Jul 28, 2025
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Jul 28, 2025
KannarFr pushed a commit to CleverCloud/pulsar that referenced this pull request Sep 22, 2025
walkinggo pushed a commit to walkinggo/pulsar that referenced this pull request Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants