-
Notifications
You must be signed in to change notification settings - Fork 298
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
fix: immediately flush data to client for event-stream response #3375
Conversation
Signed-off-by: mchtech <[email protected]>
Signed-off-by: mchtech <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3375 +/- ##
==========================================
+ Coverage 52.64% 52.76% +0.11%
==========================================
Files 192 193 +1
Lines 20439 20485 +46
==========================================
+ Hits 10761 10808 +47
+ Misses 8877 8869 -8
- Partials 801 808 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: mchtech <[email protected]>
Signed-off-by: mchtech <[email protected]>
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.
LGTM
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.
LGTM
Description
When content type is
text/event-stream
,proxy.handleHTTP
should flush data to client immediately.Related Issue
Fix #3386
same reason: golang/go#2012
Motivation and Context
MinIO client support watching and synchronizing changes from MinIO server to local fs.
It makes a "watch" request to minio server and waits server to push events when objects changed. (server also periodicly send events to client to keep connection alive, even if watched objects are not changed.)
export http_proxy=http://127.0.0.1:65001 mc mirror --watch --overwrite --debug [alias]/[bucket]/[watched-path]/ /path/to/local/
When using
dfdaemon
as a http proxy, MinIO client cannot receive event fromdfdaemon
immediately, ultil server pushes enough data to buffer.This patch can make MinIO client watch feature to work as expected and then download objects via dragonfly P2P network.
Related codes are copied from golang standard library.
Screenshots (if appropriate)
Types of changes
Checklist