Skip to content

Eventstream Refactor#816

Merged
bretambrose merged 80 commits into
mainfrom
EventstreamRefactor2
Aug 8, 2025
Merged

Eventstream Refactor#816
bretambrose merged 80 commits into
mainfrom
EventstreamRefactor2

Conversation

@bretambrose
Copy link
Copy Markdown
Contributor

@bretambrose bretambrose commented Jun 19, 2025

This PR is a substantial rewrite of the eventstream RPC bindings as well as the code-generated clients for eventstream-based services. This refactor was necessitated by a variety of deadlock and race condition problems with the original implementation. The complexity of the original implementation made targeted fixes nearly impossible to apply.

Refactor Goals

  • No blocking in destructors. In order to try and maintain behavioral compatibility with the previous implementation, we try and synchronously simulate the asynchronous events that would happen during a blocking destroy.
  • Simplified synchronization model where
    • User callbacks are never invoked inside a lock
    • C APIs are never invoked inside a lock

Public API Changes

The original implementation exposed a large amount of unnecessary details in the public API. As part of the refactor, we make a number of publicly visible changes that, while technically breaking, we believe should not be user-impacting. We consider a change to be user-impacting if it is a breaking change to a type that is used during service client interaction.

We detail each change below as well as the reasoning why we think making this change is safe. Obviously, if you were mocking out any of these changed type contracts, then they will be breaking.

  • All OperationModelContext subclasses have been made private. These types were used internally by the service model and there is no reason to expose them.
  • ContinuationCallbackData removed. Was not user-facing. Unneeded in refactor
  • ClientContinuationHandler - Public functions that were only for internal use have been removed. Class now useless but has been retained in case users were tracking operations by it.
  • ClientContinuation - Internal type that has been re-implemented as the private type ClientContinuationImpl
  • ClientOperation
    • Constructor type signature has changed - This type is only constructed internally by generated code
    • GetOperationResult API removed - This function could not be called externally without triggering exceptions by multi-consuming a promise's future
    • WithLaunchMode - This function persists but no longer does anything useful. Launch mode is no longer relevant to the processing of operations and was a mistake to include originally.
  • ClientConnection - This is an internal type used by generated service clients.
    • Constructor signature changed.
    • SendPing and SendPingResponse removed.
    • Connect and NewStream signatures changed.
    • bool operator removed

Additional Changes

We now launch an EchoTest RPC server in CI and run a much larger suite of tests against it.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Bret Ambrose added 30 commits April 11, 2025 13:55
Comment thread eventstream_rpc/source/EventStreamClient.cpp Outdated
Comment thread eventstream_rpc/source/EventStreamClient.cpp Outdated
Comment thread eventstream_rpc/source/EventStreamClient.cpp Outdated
Comment thread eventstream_rpc/source/EventStreamClient.cpp Outdated
Comment thread eventstream_rpc/source/EventStreamClient.cpp
Comment thread eventstream_rpc/source/EventStreamClient.cpp Outdated
Comment thread eventstream_rpc/source/EventStreamClient.cpp Outdated
Comment thread eventstream_rpc/tests/EventStreamClientTest.cpp Outdated
Comment thread eventstream_rpc/source/EventStreamClient.cpp
Copy link
Copy Markdown
Contributor

@sfod sfod left a comment

Choose a reason for hiding this comment

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

Beside a couple trivial things, looks good

Comment thread eventstream_rpc/tests/EventStreamClientTest.cpp Outdated
Comment thread eventstream_rpc/include/aws/eventstreamrpc/EventStreamClient.h Outdated
Comment thread eventstream_rpc/source/EventStreamClient.cpp Outdated
@bretambrose bretambrose merged commit 5a32555 into main Aug 8, 2025
42 of 44 checks passed
@bretambrose bretambrose deleted the EventstreamRefactor2 branch August 8, 2025 19:41
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