Bug description
Body
Summary
The Elasticsearch sink integration test
(elasticsearch_sink_stores_json_messages) can fail with HealthCheckFailed for iggy-connectors after many retries. Connectors runtime logs stop at Opening Elasticsearch sink... and never reach a successful open. Observed locally against a reused Testcontainers Elasticsearch instance; matches Discord failure reports. [ elastic_connector_files.zip](url)
Root cause is a combination of:
- Sink
open() can hang indefinitely on Elasticsearch HTTP (no client timeout applied), and the connectors HTTP API only binds after plugin open completes.
- Fixture reuse (
ReuseDirective::Always, container name iggy-test-elasticsearch) can attach to a days-old container without re-validating cluster health the same way as a cold start.
- On macOS,
localhost can resolve to IPv6 ::1 first while Docker publishes IPv4 0.0.0.0:HOST→9200, so the elasticsearch-rs client can
hang while a request health probe still looks fine.
- Harness readiness polled a generic HTTP path and did not fail fast if
iggy-connectors crashed during open.
Stale leftover indices alone do not appear to break the happy path on a healthy host, but accumulated leftovers on a reused container are still worth cleaning so the shared node stays healthy across runs.
Impact
- Flaky CI / local integration runs for Elasticsearch sink (and related harness readiness).
- Hard to diagnose: failure surfaces as connectors health timeout, not as an Elasticsearch client timeout error.
Proposed fix
Branch in progress: fix/elasticsearch-sink-test-flakiness
- Sink: apply
timeout_seconds (default 30s) on TransportBuilder so hung ES I/O cannot block FFI open() forever.
- Fixture container: prefer
http://127.0.0.1:{port}; always poll /_cluster/health after attach; if the reused container is unusable, docker rm -f iggy-test-elasticsearch once and recreate (named harness container only — does not touch other Elasticsearch containers).
- Fixture container: best-effort sweep of stale test indices (
iggy_messages_*, test_documents_*) older than 30 minutes so prior empty/partial indices do not accumulate on the reused node.
- Sink fixture: refresh index before each document-count poll; keep last error in timeout messages.
- Harness: poll connectors
/health and fail fast with ProcessCrashed if the child dies during retries.
Acceptance criteria
References
- Discord report / log set (connectors stuck at "Opening Elasticsearch sink...", harness
HealthCheckFailed).
- Local analysis notes (commit where flake was investigated):
6f1d5485d06c3c43afd2510e432b2f7c1a3ac41a
- Related discussion context: connectors / integration test stability.
Out of scope
- Changing connectors runtime to bind HTTP before plugin
open() (possible follow-up for clearer "starting" health).
- Broader Test containers reuse policy changes for non-Elasticsearch fixtures.
elastic_connector_files.zip
Affected area / component
Connectors
Deployment
Docker (DockerHub image)
Versions
No response
Hardware / environment
No response
Sample code
No response
Logs
No response
Iggy server config
No response
Reproduction
No response
Contribution
Good first issue
Bug description
Body
Summary
The Elasticsearch sink integration test
(
elasticsearch_sink_stores_json_messages) can fail withHealthCheckFailedforiggy-connectorsafter many retries. Connectors runtime logs stop atOpening Elasticsearch sink...and never reach a successful open. Observed locally against a reused Testcontainers Elasticsearch instance; matches Discord failure reports. [ elastic_connector_files.zip](url)Root cause is a combination of:
open()can hang indefinitely on Elasticsearch HTTP (no client timeout applied), and the connectors HTTP API only binds after plugin open completes.ReuseDirective::Always, container nameiggy-test-elasticsearch) can attach to a days-old container without re-validating cluster health the same way as a cold start.localhostcan resolve to IPv6::1first while Docker publishes IPv40.0.0.0:HOST→9200, so the elasticsearch-rs client canhang while a request health probe still looks fine.
iggy-connectorscrashed during open.Stale leftover indices alone do not appear to break the happy path on a healthy host, but accumulated leftovers on a reused container are still worth cleaning so the shared node stays healthy across runs.
Impact
Proposed fix
Branch in progress:
fix/elasticsearch-sink-test-flakinesstimeout_seconds(default 30s) onTransportBuilderso hung ES I/O cannot block FFIopen()forever.http://127.0.0.1:{port}; always poll/_cluster/healthafter attach; if the reused container is unusable,docker rm -f iggy-test-elasticsearchonce and recreate (named harness container only — does not touch other Elasticsearch containers).iggy_messages_*,test_documents_*) older than 30 minutes so prior empty/partial indices do not accumulate on the reused node./healthand fail fast withProcessCrashedif the child dies during retries.Acceptance criteria
timeout_secondsis applied to the Elasticsearch transport client.iggy-test-elasticsearchis removed and recreated once; other Docker Elasticsearch containers are never targeted./healthand detects a dead process during retries.elasticsearch_sink_stores_json_messagespasses locally against reused container.References
HealthCheckFailed).6f1d5485d06c3c43afd2510e432b2f7c1a3ac41aOut of scope
open()(possible follow-up for clearer "starting" health).elastic_connector_files.zip
Affected area / component
Connectors
Deployment
Docker (DockerHub image)
Versions
No response
Hardware / environment
No response
Sample code
No response
Logs
No response
Iggy server config
No response
Reproduction
No response
Contribution
Good first issue