[ 
https://issues.apache.org/jira/browse/DISPATCH-1878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17325104#comment-17325104
 ] 

ASF GitHub Bot commented on DISPATCH-1878:
------------------------------------------

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



##########
File path: src/adaptors/tcp_adaptor.c
##########
@@ -630,64 +780,92 @@ static void handle_connection_event(pn_event_t *e, 
qd_server_t *qd_server, void
         }
     }
     case PN_RAW_CONNECTION_CLOSED_READ: {
-        qd_log(log, QD_LOG_DEBUG, "[C%"PRIu64"] 
PN_RAW_CONNECTION_CLOSED_READ", conn->conn_id);
-        conn->q2_blocked = false;
-        handle_incoming_impl(conn, true);
+        qd_log(log, QD_LOG_DEBUG, "[C%"PRIu64"][L%"PRIu64"] 
PN_RAW_CONNECTION_CLOSED_READ",
+               conn->conn_id, conn->incoming_id);
         sys_mutex_lock(conn->activation_lock);
+        conn->q2_blocked = false;
         conn->raw_closed_read = true;
         sys_mutex_unlock(conn->activation_lock);
-        pn_raw_connection_close(conn->pn_raw_conn);
+        handle_incoming(conn, "PNRC_CLOSED_READ");
         break;
     }
     case PN_RAW_CONNECTION_CLOSED_WRITE: {
-        qd_log(log, QD_LOG_DEBUG, "[C%"PRIu64"] 
PN_RAW_CONNECTION_CLOSED_WRITE", conn->conn_id);
+        qd_log(log, QD_LOG_DEBUG,
+               "[C%"PRIu64"] PN_RAW_CONNECTION_CLOSED_WRITE",
+               conn->conn_id);
         sys_mutex_lock(conn->activation_lock);
         conn->raw_closed_write = true;
         sys_mutex_unlock(conn->activation_lock);
-        pn_raw_connection_close(conn->pn_raw_conn);
+        if (conn->ingress) {

Review comment:
       Removing the conditional causes data loss on the connector side.
   On a connector/server connection the sequence goes:
   
   - EOS seen. Call pnrc_write_close() for connector connection
   - PNRC_CLOSED_WRITE event
   - Call pnrc_connection_close()  <-- called because conditional was removed
   - PNRC_CLOSED_READ event
   - PNRC_READ and PNRC_WRITTEN to recover buffers
   - PNRC_CONNECTION_DISCONNECTED
   
   If connection_close is not called on the connector then the write_close() 
propagates to the server, the server closes the connection, the connector-side 
of the adaptor receives the server's last data, and then CLOSED_READ comes in 
and the connection is shut.




-- 
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:
us...@infra.apache.org


> Client app not getting a response through tcpListener
> -----------------------------------------------------
>
>                 Key: DISPATCH-1878
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-1878
>             Project: Qpid Dispatch
>          Issue Type: Bug
>          Components: Protocol Adaptors
>    Affects Versions: 2.0.0
>            Reporter: Fernando Giorgetti
>            Assignee: Charles E. Rolke
>            Priority: Major
>         Attachments: D-1878 @e148c.svg, 
> DISPATCH-1878_fail-pn-raw-closed-before-ingress-stream-set-up.svg, 
> dispatch-1878-trace.html
>
>
> I have a tcp-echo server running locally through:
> podman run -d --rm --name tcpecho -p 9090:9090 quay.io/skupper/tcp-go-echo
> And I have a router configured with a tcpConnector to localhost at port 9090 
> and a tcpListener at port 9999.
> I am able to use nc (netcat) to send data to the tcp-echo directly (port 
> 9090) or through
> the router (port 9999), if I run "nc 127.0.0.1 9999" and the send the data.
> But if I run it as:  "echo abcd | nc 127.0.0.1 9999" I am not seeing a 
> response, but if 
> I use port 9090 (original port) instead of 9999 (router tcpListener), then I 
> get the
> response correctly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to