Just send a notification to the writer once we passed a threshold. With
a slow writer we'd wake it up continuously while it's waiting for
the data to flush.
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
req->set_in_cb(this);
}
+#define GET_DATA_WINDOW_SIZE 2 * 1024 * 1024
+
int RGWCRHTTPGetDataCB::handle_data(bufferlist& bl, bool *pause) {
+ if (data.length() < GET_DATA_WINDOW_SIZE / 2) {
+ notified = false;
+ }
+
{
uint64_t bl_len = bl.length();
data.append(bl);
}
-#define GET_DATA_WINDOW_SIZE 2 * 1024 * 1024
uint64_t data_len = data.length();
- if (data_len >= GET_DATA_WINDOW_SIZE) {
+ if (data_len >= GET_DATA_WINDOW_SIZE && !notified) {
+ notified = true;
env->manager->io_complete(cr, io_id);
}
if (data_len >= 2 * GET_DATA_WINDOW_SIZE) {
bufferlist extra_data;
bool got_all_extra_data{false};
bool paused{false};
+ bool notified{false};
public:
RGWCRHTTPGetDataCB(RGWCoroutinesEnv *_env, RGWCoroutine *_cr, RGWHTTPStreamRWRequest *_req);