• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hyperledger-labs / fabric-smart-client / 26579103782

28 May 2026 01:54PM UTC coverage: 71.197% (+0.2%) from 70.95%
26579103782

push

github

web-flow
fix(fabric/ordering): always discard failed connections in BFT broadcast (#1485)

* fix(fabric/ordering): always discard failed connections in BFT broadcast

Broadcast() only ran its usedConnections cleanup on the overall-failure path. When a broadcast partially failed but still cleared the BFT success threshold -- e.g. 3 of 4 orderers acked, the 4th errored on Send/Recv or returned a non-SUCCESS status -- the failed connections never got discarded. Their connSem semaphore units stayed held and their gRPC streams stayed open for the lifetime of the process. Under sustained partial-failure conditions (one slow/flaky orderer that intermittently errors on Recv), this compounds until connSem is exhausted, after which getConnection falls back to its slow path and throughput collapses.

Move the cleanup loop above the threshold check so it runs on every path. Successful connections are already returned to their pools by releaseConnection (which does not touch the semaphore), so this only affects the previously-leaking failed-connection set.

Test: TestBFTBroadcaster_DiscardsFailedConnectionsOnPartialFailureSuccess exercises the success-with-partial-failure path against a pre-filled connection pool and asserts that exactly one semaphore unit is freed after the broadcast returns. Pre-fix the test fails (no unit released); post-fix it passes.

Signed-off-by: Evan <evanyan@sign.global>
Signed-off-by: Marcus Brandenburger <mbrandenburger@users.noreply.github.com>
Co-authored-by: Marcus Brandenburger <mbrandenburger@users.noreply.github.com>

4 of 0 new or added lines in 0 files covered. (NaN%)

8 existing lines in 4 files now uncovered.

28370 of 39847 relevant lines covered (71.2%)

2530.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.08
/platform/common/utils/cache/timeout.go


Build SHA Not Found

The commit SHA "4544a0cd0e48fe91c062ea21b9283cf85a81e27d" was not found in your repository, so the file cannot be loaded. This may be because you posted from a local development environment, or your CI created an ephemeral commit.

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc