-
Notifications
You must be signed in to change notification settings - Fork 845
Reduce the size of the APIHooks, eliminating enum gap #9509
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe my intentions were misplaced, but I intentionally added this gap here to allow room for new
TS_HTTP_*values without breaking compatibility:#8066
Note that any new
TS_HTTP_*value requires a correspondingTS_EVENT_HTTP_*value at the same offset. But that's not the case forTS_SSL_*values. Therefore, any newTS_HTTP_*value added must be added before theTS_SSL_*values, and therefore, without the gap, must break compatibility because all subsequentTS_SSLvalues would be shifted. This was not understood when someone addedTS_HTTP_REQUEST_BUFFER_READ_COMPLETE_HOOKat the end of this enum afterTS_SSL_*, which I'm sure was done to try to not break compatibility. I had to fix that in #8066.Maybe allowing for new
TS_HTTP_*values without breaking compatibility isn't valuable enough to justify the gap though. Can you explain what the problem is with having the gap?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #9480 . This is the root of the performance win from that PR, which was discussed at the last PR review. In essence the gap creates a large number of elements in the area that get checked for being cleared but are never used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
Can both the concerns be addressed by making the
TS_SSL_*values a separate enum?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or make the gap smaller? We only count to 20 now. Maybe set the
TS_SSL_FIRST_HOOKto 30?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what the patch does, it makes the gap smaller by not fixing it at 201.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We talked about this on slack some. The tradeoff is this:
TS_HTTP_*values (hooks) without breaking compatibility.If the decision is that we only add these hooks on major release, then we don't need a gap in these values. I'm fine with that. I just want to make sure that's understood.
Thus we can:
TS_SSL*hooks are in a separate enum. But note that the comment above these enums says that keeping them together in one enum is intentional.I'm personally fine with any of these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some discussion on slack, my vote would be to:
TS_HTTPandTS_SSL) so that the gap isn't needed. Let's keep that a separate PR if that can be done reasonably cleanly enough.