Remove allocation in server_auth filter#15839
Conversation
|
|
|
|
|
ncteisen
left a comment
There was a problem hiding this comment.
As I reviewed I had an idea to restructure this.
Instead of changing the old API, leave that as is, but add a new one called grpc_server_security_context_create_from_arena
That also removes the need for the grpc_call_get_arena function
src/core/lib/surface/call.h
Outdated
There was a problem hiding this comment.
Please add comment that this is testing only and should not be used. In fact, if there is a way to accomplish this without adding this test function, we should
There was a problem hiding this comment.
I'm not sure that just adding new function removes the need for the grpc_call_get_arena function. Since it's an internal test, let me chat with you offline about it.
|
I would move the new function to a separate PR |
|
There was a problem hiding this comment.
what about the client side create, does it have the chance of arena allocation as well?
There was a problem hiding this comment.
I will do client side in a separate PR (or I can do it in this PR after we decide on the correct way to handle server side).
|
1 similar comment
|
|
1 similar comment
|
|
There was a problem hiding this comment.
One more nit: rather than include the arena in the header, can you forward declare it here, then only include it in the .cc file
There was a problem hiding this comment.
Note google C++ style guide prefers #include to forward declaration :)
There was a problem hiding this comment.
Welp, I didn't believe it, and I looked it up...
I stand corrected. Hope, I have literally given you the opposite of good advice in this PR
|
|
Are there cases where a security context is created other than for a specific call? If not, then I'm not sure I see the value in having an alternative ctor/dtor -- the original approach of just modifying the existing ctor/dtor to use the arena seems fine to me. |
|
|
|
@markdroth It seems there are no other places where a security context is created besides for a specific call. However, there is an internal test that would need to access the call's arena in order to use the modified existing ctor. That's when I would need the get_call_arena function |
|
|
I think adding the Alternatively, consider changing the internal test to create its own arena instead of trying to use the one from the call. |
|
|
Adding |
|
I'm not proposing that we add it to the external API. It should be declared in |
|
|
Good point... sorry for the runaround Hope... |
|
|
|
|
1 similar comment
|
101319f to
f5805b7
Compare
|
|
f5805b7 to
0796789
Compare
|
|
|
1 similar comment
|
0796789 to
8f3222c
Compare
|
|
|
|
|
|
LGTM on the allocation from the arena. |
This PR adds a new API call for server_auth filter to allocate the server_security_context on the call's arena instead of doing a separate allocation.