zchuang185 commented on code in PR #3163:
URL: https://github.com/apache/brpc/pull/3163#discussion_r2559539950


##########
src/brpc/controller.cpp:
##########
@@ -1179,6 +1226,11 @@ void Controller::IssueRPC(int64_t start_realtime_us) {
         // Tag the socket so that when the response comes back, the parser will
         // stop before reading all body.
         _current_call.sending_sock->read_will_be_progressive(_connection_type);
+        auto socket_id = _current_call.sending_sock->id();
+        if (_progressive_read_timeout_ms > 0 && 
_checking_progressive_read_fds.seek(socket_id) == NULL) {
+            _checking_progressive_read_fds.insert(socket_id);
+            LOG(INFO) << "insert the progressive read fd : " << socket_id << " 
socket fds size : " << _checking_progressive_read_fds.size();

Review Comment:
   ok fix it later



##########
src/brpc/controller.h:
##########
@@ -323,7 +325,19 @@ friend void 
policy::ProcessThriftRequest(InputMessageBase*);
 
     // Make the RPC end when the HTTP response has complete headers and let
     // user read the remaining body by using ReadProgressiveAttachmentBy().
-    void response_will_be_read_progressively() { 
add_flag(FLAGS_READ_PROGRESSIVELY); }
+    void response_will_be_read_progressively() { 
+        if(has_flag(FLAGS_READ_PROGRESSIVELY) && _progressive_read_idle_tid > 
0) {
+            return;
+        }
+        bthread_attr_t tmp = BTHREAD_ATTR_NORMAL;
+        tmp.tag = _bthread_tag;
+        if(bthread_start_background(&_progressive_read_idle_tid, &tmp, 
HandleIdleProgressiveReader, this) != 0){
+            LOG(FATAL) << "Failed to start controller bthread id : " << 
_progressive_read_idle_tid;
+        }
+        LOG(INFO) << "Start Response progressive reader idle checker close 
idle_tid : " << _progressive_read_idle_tid

Review Comment:
   ok fix it later



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to