-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Add resource quota support to uv TCP code #8588
Conversation
@@ -76,13 +76,30 @@ struct grpc_tcp_server { | |||
|
|||
/* shutdown callback */ | |||
grpc_closure *shutdown_complete; | |||
|
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.
Can you add a docstring describing the role of resource_quota
?
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 don't know what the docstring should say. I just copied this from the windows implementation, and the other implementations don't say.
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.
How about "Pool of resources available to the libuv-based TCP server" (if that last bit is accurate).
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'm not sure that the first part is accurate. As far as I understand, it really is more of a "quota". You inform it when you need to allocate memory, and it tells you when that much of your quota is available.
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.
Ok, let's just leave it empty for now... there's plenty of docs in the related .h files.
grpc_resource_quota_internal_unref(exec_ctx, s->resource_quota); | ||
gpr_free(s); | ||
return GRPC_ERROR_CREATE(GRPC_ARG_RESOURCE_QUOTA | ||
" must be a pointer to a buffer pool"); |
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.
will that result in a sensible error description?
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 just copied this from the Windows implementation. I don't know.
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.
Ah, actually, I misread: it will, the value of the GRPC_ARG_RESOURCE_QUOTA
on the previous will just be concat'd to the rest of the string. Never mind.
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
*/ | ||
* |
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.
this whole block looks like an accidental whitespace/formatting change.
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.
Yeah, I don't know how I did that. It's fixed now.
This gets Node tests working on master again.