← 输入框|github.com|刷新
Skip to content

[connectors] NATS: use async-nats 0.51.0 - #7696

Merged
mihaibudiu merged 1 commit into
mainfrom
issue-7695
Oct 31, 2026
Merged

mihaibudiu merged 1 commit into
mainfrom
issue-7695

Conversation

@bestouff

Copy link
Copy Markdown
Contributor

Linked Issue

Closes #7695

Describe Manual Test Plan

Ran the NATS engine suite against a local nats-server 2.15.2:

cargo test -p static-connectors --test connector_suites -- transport::nats::

70 cases pass. The new case library_recreated_consumer_is_deleted_on_pause fails on the plain version bump (the connector deletes a name the library already replaced and the recreated consumer stays on the server) and passes with the cleanup change. Clippy on the connector crates is clean.

What changed

  • async-nats 0.47.0 to 0.51.0, with the server_2_14 feature that upstream now ships by default.
  • The library names a recreated ordered consumer {name}_{n} and deletes the one it replaces. Consumer cleanup now lists the stream's consumers and deletes every one descending from the name the connector chose, on pause, disconnect, replay end and the delayed recheck.
  • New MaxPayloadExceeded publish error kind, classified as permanent.
  • tokio-websockets 0.13 hashes the websocket handshake with sha1_smol by default. A direct dependency forwards its aws_lc_rs feature so the hash stays on aws-lc.
  • Docs: consumer lifecycle and the pull limit rows; changelog entry.

Checklist

  • Unit tests added/updated
  • Integration tests added/updated
  • Documentation updated
  • Changelog updated

Breaking Changes?

Mark if you think the answer is yes for any of these components:

Describe Incompatible Changes

None in configuration. One behaviour change: the max_batch, max_bytes and max_expiry consumer settings now reach the server, where the old library dropped them on creation. A pipeline that set a very small max_batch will see it enforced after the upgrade.

@swanandx swanandx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't understand NATS, so skimmed through this and it LGTM!

thanks!

Comment thread Cargo.toml
tokio-postgres-rustls = { version = "0.14.0", default-features = false, features = ["aws-lc-rs"] }
# Pulled in by async-nats for ws:// server URLs. Its default hashes the
# websocket handshake with sha1_smol; the feature keeps it on aws-lc-rs.
tokio-websockets = { version = "0.13.3", default-features = false, features = ["aws_lc_rs"] }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe in comment we can add keep this pinned / in sync with version that async-nates use?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 96fd8f1: the comment now says to keep the version in sync with async-nats's, and why.

The release fixes spurious MissingHeartbeat errors while messages are
buffered, pull consumers hot-looping on 409 Exceeded MaxRequest*, and
KV hangs.

Two changes reach the connector. The library now names a recreated
ordered consumer `{name}_{n}` and deletes the one it replaces, so the
cleanup on pause, disconnect, replay end and the delayed recheck lists
the stream's consumers and deletes every one descending from the name
the connector chose. Before, it deleted a name the library had already
removed and the live consumer leaked until the inactive threshold.

The publish path gains a MaxPayloadExceeded error kind, classified as
permanent. OrderedConfig limits (max_batch, max_bytes, max_expires)
now reach the server where the old library dropped them.

tokio-websockets 0.13 no longer takes aws-lc-rs from async-nats and
hashes the websocket handshake with sha1_smol. A direct dependency
forwards its aws_lc_rs feature so every hash stays on aws-lc.

Tested with the NATS engine suite (70 cases) against nats-server
2.15.2, including a new case that leaked a consumer before the fix.

Closes #7695

Signed-off-by: Xavier Bestel <xavier.bestel@feldera.com>
@bestouff
bestouff added this pull request to the merge queue Oct 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 30, 2026
@bestouff
bestouff added this pull request to the merge queue Oct 30, 2026
@mythical-fred-oss

Copy link
Copy Markdown
Contributor

CI failure analysis for run 41094581079: not this PR's fault — fairly confident.

Failed job Integration Tests / Runtime Integration Tests (gke-runners-amd64)
Failing test tests/runtime/test_adaptive_joins.py::TestAdaptiveJoins::test_adaptive_joins_balancer_policies
Error RuntimeError: program version (3) != expected program version (2)

This PR only touches the NATS connector (crates/connectors/src/transport/nats/*); it never touches the pipeline-manager program-version logic or the adaptive-joins test/code path. The test stops the pipeline, calls pipeline.modify(sql=...) once, and expects program_version to be exactly one higher — but it came back two higher, i.e. the mutating PATCH /pipelines/{name} got applied twice server-side for one client call.

Likely cause: python/feldera/rest/_httprequests.py's _is_retryable retries on 502/503/504 unconditionally, even for non-idempotent methods like PATCH, unlike its ConnectionError handling which is correctly gated on idempotent. A gateway hiccup on the known-flaky GKE CI runners (see #7465) after the server already applied the PATCH would cause a silent duplicate apply, double-bumping program_version.

Filed as #7748 with the full trace and suspected fix location.

Next step: re-queueing should pass — this failure isn't reachable from your changes.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 30, 2026
@bestouff
bestouff added this pull request to the merge queue Oct 30, 2026
@mythical-fred-oss

Copy link
Copy Markdown
Contributor

Verdict: infrastructure, not this PR. High confidence.

Failed job Runtime Integration Tests (arm64)
Failing test tests/runtime/test_spreadsheet.py::TestUDF::test_local (log lines 388-649, retried twice, failed identically each time)
Error urllib3.exceptions.ProtocolError: Response ended prematurely → requests.exceptions.ChunkedEncodingError while streaming output, ~20 min / ~13 OIDC-remint cycles into the run

This PR only touches the NATS input connector (crates/connectors/src/transport/nats/*) — nothing related to the Python SDK's output streaming, test infra, or CI auth. The prior merge-queue attempt for this PR also failed, on a different arch and a different, unrelated test (test_adaptive_joins_balancer_policies, amd64, run 41094581079) — two unrelated failures across two attempts of the same code points at environment, not the diff.

This matches the recurring "shared *-gke.ci.feldera.io instance/auth channel breaks mid-run" class already tracked in #7048 (an earlier instance there even hit this same test_spreadsheet test). I've added this run as a new data point there.

Next step: safe to re-queue; no fix needed on this branch.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 31, 2026
@mihaibudiu
mihaibudiu added this pull request to the merge queue Oct 31, 2026
@mythical-fred-oss

Copy link
Copy Markdown
Contributor

Merge queue failure: not this PR's fault

Verdict: pre-existing bug on main, unrelated to this PR. High confidence — this PR only touches NATS input (crates/connectors/src/transport/nats/...), and the failing test and code belong to a Kafka feature that landed on main three days ago and isn't present on this branch at all.

Failed job Adapter Tests (arm64)
Failing test transport::kafka::ft::output::tests::an_outage_aborts_and_replays_the_transaction
Assertion output.rs test file line 260: the spool must be released at commit — left: 190, right: 0
Introduced by 6ad915e99 "[connectors] Recover Kafka output transactions through broker outages" (main, 2026-10-28)

The test drives a mocked Kafka broker through an outage/abort/replay cycle; the commit loop reports success but the replay spool isn't fully drained. No existing issue covered it, so I filed #7760 with the evidence and assigned it to the commit's author.

Next step: re-queueing should pass once #7760 is fixed — this isn't something to change in this PR.

Merged via the queue into main with commit 9638852 Oct 31, 2026
1 check passed
@mihaibudiu
mihaibudiu deleted the issue-7695 branch October 31, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[connectors] NATS: use async-nats 0.51.0.

3 participants