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

Debug info: print all workers #1200

Merged
merged 6 commits into from
Jan 22, 2025
Merged

Conversation

ArnyminerZ
Copy link
Member

@ArnyminerZ ArnyminerZ commented Dec 27, 2024

Purpose

Right now we only provide the information of the individual sync workers for each account and data type, but no information about the "generic" workers is provided.

Example:

Sync workers:

┌───────────────────────────────────────┬─────────────────┬─────────────┬─────────┬────────────┬────────────────┐
│ Tags                                  │ State           │ Next run    │ Retries │ Generation │ Periodicity    │
├───────────────────────────────────────┼─────────────────┼─────────────┼─────────┼────────────┼────────────────┤
│ [.sync.account.AccountsCleanupWorker] │ ENQUEUED (-256) │ In 20 hours │ 0       │ 11         │ every 1440 min │
└───────────────────────────────────────┴─────────────────┴─────────────┴─────────┴────────────┴────────────────┘

Short description

  • Added workersInfoTable in DebugInfoModel which allows generating tables for workers in a more generic way.
  • Added information for AccountsCleanupWorker.

Checklist

  • The PR has a proper title, description and label.
  • I have self-reviewed the PR.
  • I have added documentation to complex functions and functions that can be used by other modules.
  • I have added reasonable tests or consciously decided to not add tests.

@ArnyminerZ ArnyminerZ linked an issue Dec 27, 2024 that may be closed by this pull request
@ArnyminerZ
Copy link
Member Author

ArnyminerZ commented Dec 27, 2024

@rfc2822 I've added the info for AccountsCleanupWorker, I don't know if any other one is desirable.

@ArnyminerZ ArnyminerZ self-assigned this Dec 27, 2024
@ArnyminerZ ArnyminerZ requested a review from rfc2822 December 27, 2024 11:46
@ArnyminerZ ArnyminerZ added the enhancement New feature or request label Dec 27, 2024
@ArnyminerZ ArnyminerZ marked this pull request as ready for review December 27, 2024 11:46
Copy link
Member

@rfc2822 rfc2822 left a comment

Choose a reason for hiding this comment

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

Could we have a list of all "other" workers which are not mentioned in the account section? Reason is that there may be old workers which have not been cancelled correctly, for instance by migrations.

Maybe we can return the IDs of the workers when we dump the account workers, remember them and at the end print all other workers (= those which were not printed yet). Or something similar.

Also I think it's time to move the debug info generation into a separate class DebugInfoGenerator, then it won't clutter the model (still UI layer) so much.

@rfc2822 rfc2822 force-pushed the 1197-debug-info-print-all-workers branch from cd4315c to 39680ee Compare January 10, 2025 15:39
@rfc2822 rfc2822 requested a review from sunkup January 13, 2025 12:37
Copy link
Member

@sunkup sunkup left a comment

Choose a reason for hiding this comment

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

The AccountsCleanupWorker is not a "sync" worker. I would rename one or both of the dumpSyncWorkersInfo methods to dumpWorkersInfo.

Not sure we really need to be able to generate other tables besides "Sync workers" and the new "Generic workers" table. Having a generic generation function seems a bit overengineered to me, but I guess it might come in handy.

Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
@rfc2822 rfc2822 force-pushed the 1197-debug-info-print-all-workers branch from 39680ee to e0c1a8b Compare January 18, 2025 11:42
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
@ArnyminerZ
Copy link
Member Author

I've done what you suggested, filtering the sync workers, and seems to work good. It's a bit more convoluted, but I think it's fine. An example of the result:


Generic workers:

┌───────────────────────────────────────┬─────────────────┬─────────────┬─────────┬────────────┬────────────────┐
│ Tags                                  │ State           │ Next run    │ Retries │ Generation │ Periodicity    │
├───────────────────────────────────────┼─────────────────┼─────────────┼─────────┼────────────┼────────────────┤
│ [.sync.account.AccountsCleanupWorker] │ ENQUEUED (-256) │ In 23 hours │ 0       │ 14         │ every 1440 min │
│ [.push.PushRegistrationWorker]        │ ENQUEUED (-256) │ In 23 hours │ 0       │ 0          │ every 1440 min │
└───────────────────────────────────────┴─────────────────┴─────────────┴─────────┴────────────┴────────────────┘

Signed-off-by: Arnau Mora <arnyminerz@proton.me>
@ArnyminerZ ArnyminerZ requested a review from sunkup January 20, 2025 11:15
sunkup
sunkup previously approved these changes Jan 20, 2025
Copy link
Member

@sunkup sunkup left a comment

Choose a reason for hiding this comment

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

You are right it still looks a bit inconvenient/awkward. I am wondering a whether it would be simpler to:

  1. Request all workInfo of all workers.
  2. Filter out the "sync-" workers by tag and display them
  3. Filter out the non "sync-" workers by tag and display them.

That would probably require workersInfoTable to only display the workInfo data and not do the querying as well.

It shows up alright though, so I think it's not worth the hassle and this is fine, like you say. 👍

Copy link
Member

@rfc2822 rfc2822 left a comment

Choose a reason for hiding this comment

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

I have moved out debug info generation into a separate class.

@rfc2822 rfc2822 merged commit 708d94b into main-ose Jan 22, 2025
8 checks passed
@rfc2822 rfc2822 deleted the 1197-debug-info-print-all-workers branch January 22, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Debug info: print all workers
3 participants