Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Ill-timed heartbearts cause handshake failures #4776

Open
kwvanderlinde opened this issue May 10, 2024 · 1 comment
Open

[Bug]: Ill-timed heartbearts cause handshake failures #4776

kwvanderlinde opened this issue May 10, 2024 · 1 comment
Assignees
Labels

Comments

@kwvanderlinde
Copy link
Collaborator

kwvanderlinde commented May 10, 2024

Describe the Bug

If a client is in the middle of a handhsake, and the time comes for a heartbeat to be sent to the server, the handshake will be corrupted by the heartbeat and the connection will fail.

To Reproduce

  1. Start a server on one machine
  2. On another machine, run MapTool under a debugger.
    1. Set a breakpoint at the top of ClientHandshake.handleMessage
    2. Connect to the server
    3. Wait on the breakpoint for more than 20 seconds.
    4. Remove the breakpoint and continue.
  3. If all went well, the server will have received reported a MESSAGETYPE_NOT_SET and the client will be shown an error about incorrect passwords.

Expected Behaviour

Heartbeats should not be sent to the server during handshake. Handshakes complete very quickly after establishing a connection, and so there shouldn't even be an opportunity to lose the server unless something very drastic is happening.

Screenshots

No response

MapTool Info

develop

Desktop

Linux Mint 21.3

Additional Context

N/A

@kwvanderlinde kwvanderlinde self-assigned this May 10, 2024
@kwvanderlinde
Copy link
Collaborator Author

After some more testing, this is actually a result of #4771.

In the past, we would only globally store the MapToolConnection once its handshake was completed. The meant that ServerCommand would not send messages (including heartbeats) to the new connection until after the handshake, though it would still try to send messages to the previous connection. With the changes in #4771, the connection is available immediately and so can accept heartbeats even during handshake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In-Progress
Development

No branches or pull requests

1 participant