Skip to content

v0.17.0

Choose a tag to compare

@github-actions github-actions released this 21 Sep 14:01

Release Notes

This release significantly enhances the Go RMB-SDK's reliability, stability, and feature set, making it more robust and production-ready. The headline feature is a new adaptive relay failover mechanism that intelligently handles relay failures. Major improvements have also been made to the client's lifecycle management to prevent resource leaks, and new API features like Request Tags have been introduced.


Major Feature: Adaptive Relay Failover

The relay selection logic has been completely re-engineered to be smarter and more resilient. The old weighted-random selection has been replaced with a new cooldown-based mechanism.

  • Adaptive Failover: A new CooldownRelaySet provides fair and adaptive relay selection. Instead of being permanently excluded, failed relays are temporarily deprioritized with a cooldown period, allowing them to be retried later.
  • Fair Retries: All configured relays get a fair chance to be selected based on their recent connection performance, ensuring the client can always find a working path if one exists.
  • Safer Timeout: The timeout for each connection attempt has been optimized, providing a more conservative and stable default in real-world network conditions.

Lifecycle & Connection Stability

This release introduces critical improvements to ensure the client runs reliably and shuts down cleanly.

  • Context-Driven Shutdown: The Peer lifecycle is now fully managed by a context.Context. Canceling the parent context triggers a clean, deterministic shutdown of all background goroutines, which is verified by goleak integration tests to prevent resource leaks.
  • Hardened TTL & Request Validation: The Time-To-Live (TTL) logic has been made safer.
    • The client now validates the request context, preventing requests with already-expired deadlines.
    • TTL values are now bounded by a DefaultTTL and MaxTTL to prevent misconfiguration.
    • Incoming requests are validated for expiration before being processed, saving resources and improving security.
  • Duplicate Connection Prevention: Relay URLs are now validated and de-duplicated to ensure the client establishes exactly one connection per unique relay host, preventing internal connection conflicts.

New Features & API Enhancements

  • Request Tags Support: The client now supports sending Request Tags in a backward-compatible way. This allows for more advanced communication with the relay, including using the new built-in TagFailFast to instruct the relay to fail immediately if a destination is offline. New methods like SendRequestWithTags and CallWithTags have been added.

Observability & Performance

  • Connection Observer: A new ConnObserver interface provides a powerful observability layer. This allows you to hook into the client's connection lifecycle to log detailed statistics, including read/write counts and latencies.
  • Buffered Channels: Internal communication channels have been buffered, improving the client's throughput and resilience under high load.

Full Changelog

  • 171e8b2 Merge branch 'development' of github.com:threefoldtech/tfgrid-sdk-go into development