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

[backport 0.14] client: Fix AsNeededBacklog hang with old cores #599

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

Conversation

digitalcircuit
Copy link
Contributor

@digitalcircuit digitalcircuit commented Mar 7, 2022

In short

  • Fix default Only fetch when needed hang with pre-0.13 cores
    • Fixes backlog fetch taking 3× time compared to 0.13 client
    • Impacts clients with Ubuntu 18.04 server (Quassel core 0.12.4)
Criteria Rank Reason
Impact ★★☆ 2/3 Fixes backlog fetch regression with cores 0.12.5 and older
Risk ★☆☆ 1/3 Mimics well-tested fixed backlog fetch method
Intrusiveness ★☆☆ 1/3 Small set of changes, shouldn't interfere with other pull requests

Details

For whatever reason, if the client doesn't call updateProgress(...); after initial backlog request, it hangs.

To fix this, AsNeededBacklogRequester has been changed to set buffering/isBuffering() to true on initialization, which causes the client to call updateProgress().

Why does the disabled GlobalUnreadBacklogRequester need to set buffering to false initially? Why does this cause the client to hang? Should buffering always be initialized to true..?

This should be investigated further in the future.

Testing

Steps

  1. Set up pre-0.13 Quassel core
    • One option: install Ubuntu 18.04 LTS in a VM, then sudo apt install quassel-core
  2. Restore an SQLite (or PostgreSQL?) database with many buffers
    • Tested with 156 buffers
  3. Connect 0.14 client, do initial setup to use the restored database
  4. Set client to Fetch only when needed backlog fetching mode
  5. Time how long connecting takes
  6. Apply this patch
  7. Rebuild, time how long connecting takes

Test case

  • 167 MB SQLite database from 2014 with 156 buffers
  • 0.12.4 core (Ubuntu 18.04)
  • 0.14-git client (Kubuntu 20.04)

Before

  • Average 9 seconds to finish backlog fetch

After

  • Average 2 seconds to finish backlog fetch

Fix the AsNeededBacklogRequester hanging the client for some time with
pre-0.13 Quassel cores (no support for Feature::BufferActivitySync).

For whatever reason, if the client doesn't call updateProgress(...);
after initial backlog request, it hangs.

Setup:
* 167 MB SQLite database from 2014 with 156 buffers
* 0.12.4 core (Ubuntu 18.04)
* 0.14-git client (Kubuntu 20.04)

Before:
* Average 9 seconds to finish backlog fetch

After:
* Average 2 seconds to finish backlog fetch

Why does the disabled GlobalUnreadBacklogRequester need to set
"buffering" to "false" initially?  Why does this cause the client to
hang?  Should "buffering" always be initialized to "true"..?

This should be investigated further in the future.
@digitalcircuit digitalcircuit force-pushed the backport-0.14-fix-asneeded-fetch-slow branch from f1ec509 to 7c0feb0 Compare March 21, 2022 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant