Race condition on Logon

7 views
Skip to first unread message

Carl Sung

unread,
Jan 22, 2026, 5:47:44 AMJan 22
to fix8 developer
In Session::start, fix8 sends a Logon message and then changes state to logon_sent:

send(generate_logon(_connection->get_hb_interval(), davi));
do_state_change(States::st_logon_sent);

In Session::handle_logon, upon receiving a Logon message, fix8 changes state to continuous if it is the initiator.

Normally, the state transition is as follows:
not_logged_in
-> logon_sent
-> logon_received
-> continuous

However, if Session::start and Session::handle_logon are run on separate threads, which is common among low latency systems, Session::handle_logon may set the state to continuous before Session::start set it to logon_sent.  This results in the Session ends up in logon_sent rather than continous:

not_logged_in
-> logon_received
-> continuous
-> logon_sent

Session::_state being atomic can't avert the race condition.  Is there a way to fix the issue?  Or the two methods are not supposed to run on different threads?

Dakka

unread,
Jan 22, 2026, 4:15:57 PMJan 22
to fix8 developer
Raise a ticket and we'll look at it.
/dakka

Carl Sung

unread,
Jan 23, 2026, 12:59:56 AMJan 23
to fix8 developer
May I know how to raise a ticket?  Doesn't seem to be able to create issue in https://github.com/fix8/fix8.
Reply all
Reply to author
Forward
0 new messages