Skip to content

Conversation

@bozimmerman
Copy link

@bozimmerman bozimmerman commented Nov 24, 2025

When realmName is set in WTF/Config.wtf, clients connect to mangosd before realmd's async PExecute completes, causing authentication failures with mismatched session keys.

Explanation:
PExecute is asynchronous and doesn't guarantee the write is visible to other database connections immediately. When the client switch to the main mangosd server is quick enough, mangosd will still see the old sessionKey value in the account table, causing auth to fail.

Fix:
Replace PExecute with synchronous Execute using explicit transaction control, and add verification loop to confirm session key is written and visible before sending authentication acknowledgement to client. I personally verified that this fix allows consistent login with realmName set, which was previously consistently failing (forcing me to remove that line from WTF/Config.wtf to even login).


This change is Reviewable

When realmName is set in WTF/Config.wtf, clients connect to mangosd before
realmd's async PExecute completes, causing authentication failures with
mismatched session keys.

Explanation:
PExecute is asynchronous and doesn't guarantee the write is visible to
other database connections immediately.  When the client switch to
the main mangosd server is quick enough, mangosd will still see the
old sessionKey value in the account table, causing auth to fail.

Fix:
Replace PExecute with synchronous Execute using explicit transaction
control, and add verification loop to confirm session key is written
and visible before sending authentication acknowledgement to client.
I personally verified that this fix allows consistent login with
realmName set, which was previously consistently failing (forcing
me to remove that line from WTF/Config.wtf to even login).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant