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

FISH-9748 bigfix: fix HA session race condition leading to session attribute loss #6956

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lprimak
Copy link
Contributor

@lprimak lprimak commented Sep 18, 2024

Description

Fixed regression introduced in #6637

Important Info

  • compare update times to stored session in HA scenarios only
  • Use store.load() instead of swapIn() to load sessions during update time comparison, as swapIn() has side effects, such as replacing session object in the session map, and calling users' activation handlers every time a session is retrieved, leading to session loss and performance issues

To further explain this, when the session is replaced in the map by swapIn(), other copies of the session hang around in other threads.
Sessions get stored in HA store at the end of each request, and only the session currently in the map gets updated.
Those other copies do not get stored in the HA store when request ends, since they are no longer in the session map.
This leads to the data loss.

Performance problem is caused by the session map thrashing, and session creation callbacks being called every time the swapIn() method is called.

Testing

Manual testing done

@lprimak lprimak changed the title enh: fix HA session race condition leading to data loss enh: fix HA session race condition leading to session attribute loss Sep 18, 2024
@lprimak lprimak marked this pull request as ready for review September 18, 2024 06:46
@Pandrex247 Pandrex247 changed the title enh: fix HA session race condition leading to session attribute loss FISH-9748 enh: fix HA session race condition leading to session attribute loss Sep 18, 2024
@lprimak lprimak changed the title FISH-9748 enh: fix HA session race condition leading to session attribute loss FISH-9748 bigfix: fix HA session race condition leading to session attribute loss Sep 18, 2024
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