Skip to content

Stream testing updates#36

Merged
iamneal merged 6 commits intomasterfrom
stream-testing-updates
Feb 19, 2026
Merged

Stream testing updates#36
iamneal merged 6 commits intomasterfrom
stream-testing-updates

Conversation

@bdodroid
Copy link
Contributor

This pull request introduces significant improvements to the GateClientAbstract class, establishing a robust, reusable framework for managing bidirectional gRPC stream clients. The main changes include implementing a template method pattern for stream lifecycle management, adding connection tracking and exponential backoff with jitter, supporting simulated network disconnects, and providing shared helpers for hung connection detection and monitoring. The GateClientJobQueue class is refactored to leverage these new shared mechanisms, removing redundant logic.

Core stream lifecycle and connection management enhancements:

  • Refactored GateClientAbstract to implement a template method pattern for stream lifecycle management, including new overridable methods (runStream, getStreamName, onStreamDisconnected) and a unified start method that handles backoff, error tracking, and connection state. Added connection tracking fields (e.g., lastMessageTime, consecutiveFailures, etc.) and shared helpers for hung connection detection and status reporting. [1] [2] [3] [4] [5] [6] [7]

  • Added exponential backoff with jitter for reconnection attempts and logic to reset gRPC's internal connect backoff timer, improving resilience to transient failures. [1] [2]

  • Introduced simulated network disconnect functionality, allowing forced disconnects and blocking reconnections for testing or operational purposes. [1] [2]

Refactoring and code cleanup:

  • Refactored GateClientJobQueue to remove redundant connection tracking and lifecycle logic, now inherited from the improved GateClientAbstract.

Build and legal updates:

  • Updated Java source and target compatibility from version 17 to 21 in the Gradle build configuration

Braden Olsen added 4 commits February 11, 2026 10:07
Implements a new class for improved bidirectional event streaming. Introduces exponential backoff with jitter for reconnection attempts, addressing connection stability issues. Enhances logging for better monitoring and diagnostics.

Introduces interface improvements to streamline event processing across multiple streams. Extends existing job queue functionality to incorporate similar reconnection and backoff logic, enhancing its robustness.

Relates to stream-testing-updates branch.
Reorganizes GateClient classes by extracting shared logic into an abstract
class, enabling more structured and reusable stream lifecycle management.
Introduces additional monitoring and error handling, especially for gRPC
connections, including exponential backoff and connection health checks.
Updates gRPC library versions to ensure compatibility and bug fixes.

Relates to stream-testing-updates
Upgrades source and target compatibility to Java 21 in build
files for improved performance and access to the latest language
features.

Adds @ExecuteOn(TaskExecutors.BLOCKING) annotation in
AgentsController to specify execution context, promoting
performance efficiency for I/O-bound operations.

Enhances code readability by adjusting comment formatting.

Relates to stream-testing-updates
Introduces a check for routine stream closures using a new method
'isRoutineStreamClosure'. Logs routine server-initiated closures
as debug instead of error, reducing noise in logs.

Improves error handling by distinguishing between expected and
unexpected stream closures.

Relates to stream stability improvements.
@bdodroid bdodroid requested a review from iamneal February 18, 2026 19:23
Braden Olsen added 2 commits February 18, 2026 12:33
Upgrades JDK setup in GitHub workflows from version 17 to 21 to leverage
new features and improvements. Removes obsolete simulated network
disconnect functionality from GateClientAbstract, simplifying the
codebase and reducing the potential for errors during testing.

Streamlines code as part of ongoing stream-testing updates.
Switches to using a virtual thread per task executor for improved
concurrency management and performance. This change enables more
efficient handling of concurrent tasks by leveraging lightweight
virtual threads.

Relates to stream-testing-updates
@iamneal iamneal merged commit 0b97878 into master Feb 19, 2026
3 checks passed
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.

2 participants