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

Fix server crashed, regular cleanups, improve configs, etc... #306

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hweihwang
Copy link
Contributor

@hweihwang hweihwang commented Dec 9, 2024

Issue

The whiteboard server crashes after running for 25+ minutes (#258) due to:

  • The socket data gets invalidated/removed but the socket is still active
    => Mostly because of the LRU cache evicting data while the socket connection is still alive
new LRUCache({
max: 1000,
ttl: 30 * 60 * 1000,
ttlAutopurge: true,

(My mistake for not separate the storage of Rooms Data and socket/session data)

Fix

  • Using normal in memory storage for storing socket data (session data) instead of LRU (still along with redis for cluster setups) since the socket data can live as long as the connection alive and we can manually manage that easily (unlike Rooms data a bit more tricky when manually manage)
  • Better try catch to handle exception
  • Doing some regular cleanups for those LRU( Or In-mem) data (Feature Request: configure automatic saving #295 can be involved since we'll do the savings along with too)

@juliusknorr
Copy link
Member

I know it is in draft and I haven't checked the code yet, but maybe you can provide a short summary on why it crashed and how the fix changes that to the PR description :)

@hweihwang hweihwang force-pushed the fix-whiteboard-crashed branch 2 times, most recently from 2def488 to fb9f2f1 Compare December 16, 2024 14:01
@hweihwang hweihwang force-pushed the fix-whiteboard-crashed branch from fb9f2f1 to 8082534 Compare December 30, 2024 08:08
@hweihwang hweihwang changed the title Fix server crashed, regular cleanups Fix server crashed, regular cleanups, improve configs, etc... Dec 30, 2024
@hweihwang hweihwang force-pushed the fix-whiteboard-crashed branch from 8082534 to d127ab3 Compare December 30, 2024 08:11
@hweihwang
Copy link
Contributor Author

Picking configs, constants improvements from https://github.com/nextcloud/whiteboard/pull/226/files for not blocking merge

@hweihwang hweihwang force-pushed the fix-whiteboard-crashed branch 2 times, most recently from 8262a7a to 96994a8 Compare December 30, 2024 09:06
Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comment, otherwise that looks good 👍

@hweihwang hweihwang force-pushed the fix-whiteboard-crashed branch from 96994a8 to b97985f Compare December 30, 2024 10:54
@hweihwang hweihwang linked an issue Dec 30, 2024 that may be closed by this pull request
@hweihwang hweihwang force-pushed the fix-whiteboard-crashed branch from b97985f to 434437d Compare January 3, 2025 09:44
@hweihwang hweihwang marked this pull request as ready for review January 3, 2025 09:53
@hweihwang hweihwang requested a review from grnd-alt as a code owner January 3, 2025 09:53
@hweihwang hweihwang requested a review from juliusknorr January 3, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants