Remove a layer of Action from HttpCacheSM #7819
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Yet another attempt to address issue #7705. Based on the discussion on PR #7807, @masaori335 convinced me that the captive_action in HttpCacheSM is not doing anything for us. We would be better off passing through the pending_action that we received from the CacheProcessor (which points at the _action member of the CacheVC). The only point of the pending_action member in HttpSM is to cancel outstanding actions if the HttpSM goes away. Nothing looks at the cancel bit of the HttpCacheSM other than some asserts.
@SolidWallOfCode and I reviewed the lifecycle of the HttpCacheSM::pending_action because we were concerned that the current logic would lose the CacheVC actions in case the HttpSM goes away while the cache is still opening. However, ultimately the HttpSM will close the CacheVC's which will clean up outstanding actions in HttpSM::kill_this
So we can safely return the HttpCacheSM::pending_action or ACTION_RESULT_DONE instead of the captive action. It doesn't matter that the HttpSM cancels the action through its pending_action member since the CacheVC cleanup will ultimately do it. However, it is important that an action is returned so HttpSM knows whether the open action completed immediately or not.
This should solve the assert by removing the assert and associated data structure.
In fact, I think we can get rid of the HttpCacheSM::pending_action member too. I'll add another commit to do that.
This closes #7705