Fix stale connection errors (NoHttpResponseException)#45
Merged
Conversation
BREAKING CHANGE: Renamed :timeout to :connection-ttl for clarity. Connection pool options: - :connection-ttl (default: 30000ms) - how long connections live in the pool - :validate-after-inactivity (default: 5000ms) - checks idle connections before reuse, preventing NoHttpResponseException from stale connections - :threads (default: 100) - max total connections in pool - :default-per-route (default: 100) - max connections per route - :insecure? (default: false) - allow self-signed SSL certificates Request timeout options (applied to every request): - :connection-timeout (default: 10000ms) - time to establish TCP connection - :socket-timeout (default: none) - time to wait for response data Also removes deprecated PoolingClientConnectionManager from schema.
8f23af1 to
15a34ed
Compare
DeLaGuardo
approved these changes
Dec 10, 2025
ereteog
approved these changes
Dec 10, 2025
sayerada
added a commit
to threatgrid/ctia
that referenced
this pull request
Dec 15, 2025
Addresses socket timeout errors occurring at exactly 10 seconds for long-running ElasticSearch queries (e.g., queries with 1000+ sub-requests that take several minutes). Root cause: After ductile PR #45 was merged, the new connection management defaults include a 10-second connection-timeout that is being reused as socket-timeout when not explicitly set. This causes intermittent failures for requests that take longer than 10 seconds. Solution: Explicitly set timeout parameters when creating ES connections: - socket-timeout: 600000ms (10 minutes) - allows long-running queries - connection-timeout: 10000ms (10 seconds) - reasonable for establishing connection - validate-after-inactivity: 5000ms (5 seconds) - prevents NoHttpResponseException This is a temporary workaround until ctia's properties schema is updated to support these new ductile parameters (socket-timeout, connection-timeout, validate-after-inactivity) as configurable properties. Related: - ductile PR #45: threatgrid/ductile#45 - Symptom: Requests failing at exactly 10s with socket timeout errors - Evidence: Some requests succeed at 16s, 24s, 28s while others fail at 10s
gbuisson
pushed a commit
to threatgrid/ctia
that referenced
this pull request
Jan 30, 2026
* Fix: Add explicit timeouts for ElasticSearch connections Addresses socket timeout errors occurring at exactly 10 seconds for long-running ElasticSearch queries (e.g., queries with 1000+ sub-requests that take several minutes). Root cause: After ductile PR #45 was merged, the new connection management defaults include a 10-second connection-timeout that is being reused as socket-timeout when not explicitly set. This causes intermittent failures for requests that take longer than 10 seconds. Solution: Explicitly set timeout parameters when creating ES connections: - socket-timeout: 600000ms (10 minutes) - allows long-running queries - connection-timeout: 10000ms (10 seconds) - reasonable for establishing connection - validate-after-inactivity: 5000ms (5 seconds) - prevents NoHttpResponseException This is a temporary workaround until ctia's properties schema is updated to support these new ductile parameters (socket-timeout, connection-timeout, validate-after-inactivity) as configurable properties. Related: - ductile PR #45: threatgrid/ductile#45 - Symptom: Requests failing at exactly 10s with socket timeout errors - Evidence: Some requests succeed at 16s, 24s, 28s while others fail at 10s * Fix: Correct merge order to respect user configuration User-provided configuration in props should take precedence over default timeout values. This allows future flexibility if these parameters are added to the properties schema.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix stale connections and add connection pool configuration
Problem: Production NoHttpResponseException errors caused by stale pooled
connections that the server had closed but the client was still trying to reuse.
Solution: Add validate-after-inactivity option (default: 5000ms) that checks idle
connections before reuse, preventing stale connection errors.
Additional improvements:
default, for long-running operations)
60s)
Migration:
;; Before
;; After (same behavior, just explicit)