Fix infinite recursion in Session impl for SessionState#20148
Open
vkverma9534 wants to merge 1 commit intoapache:mainfrom
Open
Fix infinite recursion in Session impl for SessionState#20148vkverma9534 wants to merge 1 commit intoapache:mainfrom
vkverma9534 wants to merge 1 commit intoapache:mainfrom
Conversation
The Session trait implementation for SessionState accidentally called its own trait methods (e.g. self.session_id()), causing infinite recursion and stack overflow at runtime. This change fixes the issue by explicitly calling the corresponding inherent SessionState methods using fully qualified syntax. No behavior changes intended beyond removing the recursion bug.
Contributor
|
Do we have a reproducer for this? I'm fairly sure Rust/Clippy will warn us of infinite recursion in cases like this; I also took a look and rust-analyzer seems to resolve the function properly 🤔 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The Session trait implementation for SessionState accidentally called its own trait methods (e.g. self.session_id()), causing infinite recursion and stack overflow at runtime.
This change fixes the issue by explicitly calling the corresponding inherent SessionState methods using fully qualified syntax. No behavior changes intended beyond removing the recursion bug.
This appears to be unintended recursion. I can also add a small regression test if that helps confirm intent.