Conversation
6a4196e to
3e4620d
Compare
jmarantz
left a comment
There was a problem hiding this comment.
looks like a good start!
|
/wait |
jmarantz
left a comment
There was a problem hiding this comment.
Looks like this is still in progress. Can you ping when you have a working implementation of Chunker? Even if it just delegates to Buffer::Instance and doesn't actually do any chunking, this might be worth putting into the codebase as an intermediate point.
You could actually develop a real Chunker in parallel, in a separate PR, without integrating it into Admin. It should be fully testable with unit tests and mocks.
/wait
|
/retest |
|
Retrying Azure Pipelines: |
|
/retest |
|
Retrying Azure Pipelines: |
|
/retest |
|
Retrying Azure Pipelines: |
|
@jmarantz hi, I have done first step: use after review I will remove unrelated changes like I will try to implement chunking at local. |
source/common/buffer/buffer_impl.h
Outdated
There was a problem hiding this comment.
We shouldn't need to change BufferImpl at all, or add the complexity of multiple inheritance here.
There was a problem hiding this comment.
I met an issue in include/envoy/server/admin.h:
Http::Code AdminImpl::request(absl::string_view path_and_query, absl::string_view method,
Http::ResponseHeaderMap& response_headers, std::string& body) {
AdminFilter filter(createCallbackFunction());
auto request_headers = Http::RequestHeaderMapImpl::create();
request_headers->setMethod(method);
filter.decodeHeaders(*request_headers, false);
Buffer::OwnedImpl response; <===
Http::Code code = runCallback(path_and_query, response_headers, response, filter); <===
Utility::populateFallbackResponseHeaders(code, response_headers);
body = response.toString();
return code;
}
Chunker can not use anything in Buffer::OwnedImpl, I do not find a good way to do it :(
There was a problem hiding this comment.
I think Chunker could contain a Buffer::OwnedImpl (not inherit from it), and delegate to it. draining as needed to keep it under some max size. It will need to be passed, in its constructor, a network socket it can use to drain bytes as it hits its buffering limit.
If this is seeming too complex at this point we can assign someone else to do it. The work you've done so far is actually pretty helpful and you could finish that off by just (for now) making "Chunker" an alias for buffer in admin.h:
using Chunker = Buffer::Instance;
and then in a further PR we can actually make a real implementation of Chunker that auto-drains into the network.
There was a problem hiding this comment.
Got it, thanks for your patience and help, I learn a lot from you @jmarantz !
|
/wait |
Signed-off-by: Long Dai <long0dai@foxmail.com>
Signed-off-by: Long Dai <long0dai@foxmail.com>
Signed-off-by: Long Dai <long0dai@foxmail.com>
|
/retest |
|
Retrying Azure Pipelines: |
|
/retest |
|
Retrying Azure Pipelines: |
|
This looks like it's getting close. Would you ind creating a Google Doc describing in more detail the overall strategy of what we're trying to do? That will put this PR in context and perhaps make it easier for senior maintainers to review after I'm done. They may also have important comments about the strategy. It also might help to start working on a real implementation of Chunker in parallel in a different PR. It's quite possible there's already code like this in Envoy. Maybe @alyssawilk may know where. My suggestion is to structure it something like this: This class can be written and tested in a tight unit test without doing any networking or worrying about admin semantics. The unit test can supply a Assuming this class (or a similar one) isn't already implemented somewhere. |
|
I would do that, maybe need some time to finish. |
|
/retest |
|
Retrying Azure Pipelines: |
|
@jmarantz CI pass, please review again, thanks |
jmarantz
left a comment
There was a problem hiding this comment.
This looks fine now and can potentially be merged as is. However I think to do that we need buy-in from a @envoyproxy/senior-maintainers on the plan first. Once we have that available & approved we can merge this.
In the meantime you can start working in a parallel PR on a Chunker implementation.
|
/wait |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
/wait |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Signed-off-by: Long Dai long0dai@foxmail.com
Commit Message:
Add chunker class to manage the chunking process.
First part of #16139
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]