You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/04/16 18:23:08 UTC

[GitHub] [qpid-dispatch] ChugR commented on a change in pull request #1129: DISPATCH-1878: Handle half-closed TCP connections - DO NOT MERGE

ChugR commented on a change in pull request #1129:
URL: https://github.com/apache/qpid-dispatch/pull/1129#discussion_r615043535



##########
File path: src/adaptors/tcp_adaptor.c
##########
@@ -57,11 +57,15 @@ struct qdr_tcp_connection_t {
     qdr_delivery_t       *outstream;
     bool                  ingress;
     bool                  flow_enabled;
+    bool                  incoming_started;
     bool                  egress_dispatcher;
     bool                  connector_closed;//only used if egress_dispatcher=true
     bool                  in_list;         // This connection is in the adaptor's connections list
-    bool                  raw_closed_read;
-    bool                  raw_closed_write;
+    bool                  raw_closed_read;   // proton event seen
+    bool                  raw_closed_write;  // proton event seen or write_close called
+    bool                  raw_read_shutdown; // stream closed
+    bool                  read_eos_seen;
+    qd_buffer_list_t      early_raw_read_bufs; // read from raw conn before ingress stream ready

Review comment:
       This was on recommendation from proton developers: giving buffers to the read side is pretty harmless.
   
   Reading from raw connection before the ingress stream is ready is the first strategy of several that has worked. Over the wire the client has executed open-write-close before the TCP adaptor has even been notified that the connection has been accepted. Then follows a READ event which TCP can't handle since it has no stream or credit. Then follows a READ_CLOSED which still can't be handled since there is no stream or credit. Eventually the stream comes up and credit arrives but these events don't arrive in the proper context for reading the raw connection. One could schedule a wake but complicated state is required to signal that on a random wake it's time to read from a closed connection. 




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org