Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
360da99
Fix semaphore permit leaks in HttpJettySolrClient's AsyncTracker: pre…
janhoy Mar 19, 2026
ab9401a
Rewrite comments in test class
janhoy Apr 14, 2026
db3fa14
Review comment - make sure we can complete a failed request even if p…
janhoy Apr 14, 2026
cc6d345
Simpler initialization of MAX_OUTSTANDING_REQUESTS
janhoy Apr 14, 2026
9074c67
Do not release permit when result == null
janhoy Apr 14, 2026
5bbdf53
Fix review comment about test waiting 2000 ms
janhoy Apr 14, 2026
6068e53
Simplify failure dispatch
janhoy Apr 14, 2026
9f481ba
Correct some javadoc
janhoy Apr 14, 2026
41b9ad3
Review feedback: Change sysprop name
janhoy Apr 14, 2026
633d7d4
Review feedback: No quotes in changelog title
janhoy Apr 14, 2026
c8e01f8
Use only 1 node for test cluster configuration in AsyncTrackerSemapho…
janhoy Apr 14, 2026
d2d3d59
Factor out fakeServer logic into an inner class and make sure this se…
janhoy Apr 14, 2026
3f7dcb9
Revert to using common executor for failure dispatch due to leak issu…
janhoy Apr 14, 2026
b7c6c1e
Avoid test hanging due to executor not able to terminate
janhoy Apr 14, 2026
a08833c
Review: Use SolrParams.of()
janhoy Apr 14, 2026
f0fdea8
Print debug log instead of silently ignoring Exceptions
janhoy Apr 14, 2026
e482cf2
Fix unstable test
janhoy Apr 15, 2026
08e1a3d
Rename metric name from "solr.http.client.async_permits" to "solr.cli…
janhoy Apr 15, 2026
1e33550
Merge branch 'main' into SOLR-18174-hang-repro-fix
janhoy Apr 15, 2026
289f847
Fix precommit - log calls
janhoy Apr 15, 2026
5a92f99
Precommit fix fully-qualified-class
janhoy Apr 15, 2026
0f3f382
Reference guide additions for sysprop and metrics
janhoy Apr 15, 2026
8c3b376
Review feedback - add warn log when completing request on IO thread
janhoy Apr 15, 2026
a543701
Move the documentation of max distributed requests sysprop from solrc…
janhoy Apr 15, 2026
78b0d7a
Change log for FakeTcpServer from debug to warn to aid in debugging p…
janhoy Apr 16, 2026
88e327b
Precommit - satisfy :solr:solr-ref-guide:checkSiteLinks
janhoy Apr 16, 2026
e23e2e4
Merge branch 'main' into SOLR-18174-hang-repro-fix
janhoy Apr 16, 2026
0119635
Fix test race-condition bug by setting maxOutstandingRequests as inst…
janhoy Apr 17, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: Fix semaphore permit leaks in HttpJettySolrClient's AsyncTracker. Avoid IO-thread deadlock on connection failure retries. Add a new metric gauge solr.http.client.async_permits
type: fixed
authors:
- name: Jan Høydahl
url: https://home.apache.org/phonebook.html?uid=janhoy
links:
- name: SOLR-18174
url: https://issues.apache.org/jira/browse/SOLR-18174
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static org.apache.solr.util.stats.InstrumentedHttpListenerFactory.KNOWN_METRIC_NAME_STRATEGIES;

import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.metrics.ObservableLongGauge;
import java.lang.invoke.MethodHandles;
import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -85,6 +86,7 @@ public class HttpShardHandlerFactory extends ShardHandlerFactory
protected volatile HttpJettySolrClient defaultClient;
protected InstrumentedHttpListenerFactory httpListenerFactory;
protected LBAsyncSolrClient loadbalancer;
private ObservableLongGauge asyncRequestsGauge;

int corePoolSize = 0;
int maximumPoolSize = Integer.MAX_VALUE;
Expand Down Expand Up @@ -352,6 +354,7 @@ public void close() {
ExecutorUtil.shutdownAndAwaitTermination(commExecutor);
}
}
IOUtils.closeQuietly(asyncRequestsGauge);
try {
SolrMetricProducer.super.close();
} catch (Exception e) {
Expand Down Expand Up @@ -440,5 +443,20 @@ public void initializeMetrics(SolrMetricsContext parentContext, Attributes attri
commExecutor =
solrMetricsContext.instrumentedExecutorService(
commExecutor, "solr.core.executor", "httpShardExecutor", SolrInfoBean.Category.QUERY);
if (defaultClient != null) {
asyncRequestsGauge =
solrMetricsContext.observableLongGauge(
"solr.client.request.async_permits",
"Outstanding async HTTP request permits in the Jetty SolrJ client"
+ " (state=max: configured ceiling; state=available: currently unused permits).",
Comment thread
janhoy marked this conversation as resolved.
measurement -> {
measurement.record(
defaultClient.asyncTrackerMaxPermits(), Attributes.of(STATE_KEY_ATTR, "max"));
measurement.record(
defaultClient.asyncTrackerAvailablePermits(),
Attributes.of(STATE_KEY_ATTR, "available"));
},
null);
}
}
}
Loading
Loading