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

Handle job gone errors and improve promise management #379

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

Conversation

eduard-fa
Copy link

@eduard-fa eduard-fa commented Nov 8, 2024

Changes

  • Ignore job missing errors on data purging: prevents errors when the job is already deleted before the purging process
  • Resolves a race condition that could occur when removing a completed promise from the promises list (removing job using potentially outdated index)
  • Ensures that promises are properly removed from the list even if an error occurs during the purging process

Checklist

  • Apply one of following labels; major, minor, patch or skip-release
  • I've updated the documentation, or no changes were necessary
  • I've updated the tests, or no changes were necessary

@eduard-fa eduard-fa added the patch label Nov 8, 2024
@eduard-fa eduard-fa self-assigned this Nov 8, 2024

try {
await Promise.all([updateDataPromise, clearLogsPromise])
} catch (error) {
Copy link
Collaborator

@kibertoad kibertoad Nov 8, 2024

Choose a reason for hiding this comment

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

you may want to use allSettled instead of all with try-catch, if you want to wait for all promises to resolve regardless of how successful that is

…moving completed promise from promises list; Fix promise stays in the list if error occurs during purging
@eduard-fa eduard-fa force-pushed the feat/ignore-job-gone-errors-on-data-purging branch from f0383d7 to 99aefb3 Compare November 11, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants