| Ticket UUID: | 4811399edce1b2ef306b93141169d921ef833f8d | |||
| Title: | comm disconnect after race condition | |||
| Type: | Bug | Version: | 4.6.3.1 | |
| Submitter: | anonymous | Created on: | 2015-11-09 22:32:28 | |
| Subsystem: | comm | Assigned To: | nobody | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Open | Last Modified: | 2026-11-16 00:06:15 | |
| Resolution: | None | Closed By: | nobody | |
| Closed on: | ||||
| Description: |
When 2 incoming connections are received simultaneously, comm displays a race condition warning. If the connections are from the same process, an error is displayed when the process disconnects.
To replicate, run the following scripts in tclsh:
Server:
package require comm
::comm::comm configure -port 5000
vwait forever
Client:
package require comm
proc mysocket {host port} {
set sock [socket -async $host $port]
update
return $sock
}
::comm::comm config -socketcmd mysocket -listen 0
after 0 [list ::comm::comm send {5000 localhost} pid]
after 0 [list ::comm::comm send {5000 localhost} pid]
after 1000 set forever 1
vwait forever
This produces the following output on the server:
commIncoming race condition: 0
peers=sock0000000002CC4FB0 port=5000
can't read "comm(::comm::comm,pending,0)": no such element in array
while executing
"foreach s $comm($chan,pending,$id) {
if {[string equal "callback" [lindex $s end]]} {
set ser [lindex $s 0]
if {[info exists comm($chan,ret..."
(procedure "commLostConn" line 14)
invoked from within
"commLostConn $chan $fid "target application died or connection lost""
(procedure "::comm::commCollect" line 12)
invoked from within
"::comm::commCollect ::comm::comm sock0000000002CC4E30"
The warning message is distracting since the user can't prevent the condition, but the error message should definitely be removed.
| |||
| User Comments: |
serhiy.storchaka added on 2026-11-16 00:06:15:
Proposed fix in branch comm-lost-conn-peer: commLostConn assumed one connection per remote id. Now only the connection registered as the peer clears the pending sends and the peer entry, and the race warning is no longer printed for remote id 0, which all non-listening clients share. Test comm-4811399edc. Also fixes [1491894fff]. | |||
Home
Blog
Docs
Downloads
Tickets
Timeline
Branches
Tags
Wiki