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

Avoid performing duplicate tasks when they are rebased #2690

Merged
merged 4 commits into from Aug 30, 2020

Conversation

ajsutton
Copy link
Contributor

PR Description

Previously when a task was rebased, it was only added to the pending tasks list once the task it was being rebased onto completed. If duplicate tasks were requested before the dependent task completed, they would all be scheduled to execute after it. This resulted in duplicate work being performed and a NullPointerException when later tasks completed and found the result future had already been removed.

Now the result future is added to pending tasks immediately regardless of whether the task is rebased or immediately added to the queue. Duplicates then simply return the existing pending result and are not executed themselves.

Fixed Issue(s)

fixes #2685
fixes #2686

Documentation

  • I thought about documentation and added the documentation label to this PR if updates are required.

Copy link
Contributor

@rolfyone rolfyone left a comment

Choose a reason for hiding this comment

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

LGTM

@ajsutton ajsutton merged commit cd23274 into Consensys:master Aug 30, 2020
@ajsutton ajsutton deleted the avoid-duplicate-tasks-on-rebase branch August 30, 2020 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repeated regeneration of state NullPointerException in CachingTaskQueue
2 participants