Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More dispatch pipeline refactoring #1929

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

bernardnormier
Copy link
Member

Fixed version of #1925.

This is a small follow-up to #1923. In #1923, ObjectAdapter::dispatcher() returns the dispatch pipeline, which is not quite correct when you insert your dispatcher into another object adapter.

The desired behavior is:
Connection => logger middleware associated with connection's OA => observer middleware associated with connection's OA => second OA dispatcher => second OA servant

We don't want to duplicate the logger and dispatch observer actions.

This PR fixes the code to achieve this desired behavior. I also updated the metrics test to verify it works.

@@ -1382,7 +1382,7 @@ Ice::ConnectionI::message(ThreadPoolCurrent& current)
uint8_t compress = 0;
int32_t requestId = 0;
int32_t invokeNum = 0;
ObjectAdapterPtr adapter;
ObjectAdapterIPtr adapter;
Copy link
Member Author

Choose a reason for hiding this comment

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

We need the IPtr to get the dispatchPipeline function.

// There is no need to clear _dispatchPipeline during destroy because _dispatchPipeline does not hold onto this
// object adapter directly. It can hold onto a communicator that holds onto this object adapter, but the
// communicator will release this refcount when it is destroyed or when the object adapter is destroyed.
const ObjectPtr _dispatchPipeline; // must be declared after _servantManager
Copy link
Member Author

Choose a reason for hiding this comment

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

It's now const thanks to the helper function in the .cpp.

@bernardnormier bernardnormier merged commit ce9350d into zeroc-ice:main Mar 13, 2024
22 checks passed
@bernardnormier bernardnormier deleted the object-dispatch3 branch May 10, 2024 23:43
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.

3 participants