TLS tunnels in Transaction have two logical threads of execution - server->client and client->server. When one end shuts down, both handlers might race each other trying to release connections. This leads to access violations, at least on Windows in debug builds.
We should consider ways to prevent this. It's daunting to consider guarding connections with mutexes everywhere; maybe an atomic_bool is_open_ would suffice. Not foolproof, but it could address the shutdown-race.
TLS tunnels in Transaction have two logical threads of execution - server->client and client->server. When one end shuts down, both handlers might race each other trying to release connections. This leads to access violations, at least on Windows in debug builds.
We should consider ways to prevent this. It's daunting to consider guarding connections with mutexes everywhere; maybe an atomic_bool
is_open_
would suffice. Not foolproof, but it could address the shutdown-race.