lzx404243 commented on issue #10455:
URL:
https://github.com/apache/trafficserver/issues/10455#issuecomment-1753417930
In the core, I noticed that HttpSM of a request from `1.1.1.1:80` was being
added to ConnectingEntry of `1.1.1.1:443`
I believe this is how the crash happened:
- Suppose both `1.1.1.1:80` and `1.1.1.1:443` are both in the thread
Connection map.
- Now, a new request came in from `1.1.1.1:80`, let’s call it **request A**.
- In `add_to_existing_request()`, `find()` returns the iterator pointing to
the ConnectingEntry for `1.1.1.1:80`.
- The following condition is false, so the iterator is incremented:
`(proposed_hostname == ip_iter->second->hostname && proposed_sni ==
ip_iter->second->sni && proposed_cert == ip_iter->second->cert_name &&
ip_iter->second->_connect_sms.size() < 50)`
- The iterator now points to `1.1.1.1:443`, since
- the hash code is generated based on the IP, therefore the entries for
both keys/ips are in the same bucket in the map.
- as we pointed out, the ip_iter->first == ip condition in the `while()`
loop only checks IP address, not the port . So it is able to continue the
iteration on the same ip with different port.
- HttpSM for request from `1.1.1.1:80` is added to a ConnectingEntry of
`1.1.1.1:443`.
- All HttpSMs are successfully processed for ConnectingEntry for 1.1.1.1:80,
the ConnectingEntry for `1.1.1.1:80` is removed from the thread connection map.
- Client abort detected on **request A**. Tearing down HttpSM
- `kill_this()` is called. In `cancel_pending_server_connection()`, it
searches the thread connection map with key `1.1.1.1:80`. Now since it has been
removed from the map, the search would fail. Therefore, the HttpSM, still in
ConnectingEntry of `1.1.1.1:443` is not cleaned up.
- When processing all HttpSMs from ConnectingEntry of `1.1.1.1:443`, the
crash is triggered.
--
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]