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

Still crashes upon some state cache saves #257

Closed
KitsuneRal opened this issue Nov 17, 2018 · 3 comments
Closed

Still crashes upon some state cache saves #257

KitsuneRal opened this issue Nov 17, 2018 · 3 comments
Assignees
Labels
crash A crash occurs in the library code

Comments

@KitsuneRal
Copy link
Member

No description provided.

@KitsuneRal KitsuneRal added the crash A crash occurs in the library code label Nov 17, 2018
@KitsuneRal
Copy link
Member Author

At least one more reason for crashing is not a regression: Connection::saveState() leaves a room for accessing a deleted invitation or forgotten room object due to a race condition introduced by calling processEvents() that may delete rooms already being iterated. Possible fixes include:

  • using QPointer for the rooms map (increases the space consumed by this map almost two-fold);
  • pre-saving JSON for each room, with saveState() just dumping those objects to one array (given that saveState() is called from clients, we'll have to pre-save upon each room update, rather than just before saving the cache, which is potentially expensive);
  • split the cache per-room (quite a considerable change to the caching code; again, either the clients will have to diligently trigger to-be Room::saveState() per each room, or we should take this on the library side altogether - which sounds not a bad idea at all, in fact).

KitsuneRal added a commit that referenced this issue Nov 19, 2018
This was one more cause of #257 - the case when a redaction on a state
event arrives in the same batch as the redacted event.
@KitsuneRal KitsuneRal self-assigned this Nov 20, 2018
@KitsuneRal
Copy link
Member Author

The last option is now in implementation.

@KitsuneRal
Copy link
Member Author

The cache is written but not read properly.

@KitsuneRal KitsuneRal reopened this Nov 23, 2018
@KitsuneRal KitsuneRal moved this to Version 0.5(.x) - Released in libQuotient 1 May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash A crash occurs in the library code
Projects
Status: Version 0.5(.x) - Released
Development

No branches or pull requests

1 participant