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

Remove extra scheduled entries from pending queue #1569

Merged
merged 2 commits into from Jun 28, 2017
Merged

Conversation

@PtrTeixeira
Copy link
Contributor

@PtrTeixeira PtrTeixeira commented Jun 19, 2017

There are now - deliberately - cases when multiple scheduled tasks can
enter the pending queue at once. However, scheduled tasks need to be
globally unique - there should only ever be one between the pending
queue and the active tasks list. Currently any duplicates that reach the
pending queue are held there. This instead clears them out when they are
duplicated, relying instead on the task being started on TASK_DONE.

/cc @ssalinas

There are now - deliberately - cases when multiple scheduled tasks can
enter the pending queue at once. However, scheduled tasks need to be
globally unique - there should only ever be one between the pending
queue and the active tasks list. Currently any duplicates that reach the
pending queue are held there. This instead clears them out when they are
duplicated, relying instead on the task being started on `TASK_DONE`.
} else if (updatedRequest.isScheduled()
&& (pendingRequest.getPendingType() == PendingType.NEW_DEPLOY
|| pendingRequest.getPendingType() == PendingType.TASK_DONE)) {
// If we are here, there is already an immediate of run of the scheduled task launched. Drop anything that would
Copy link
Member

@ssalinas ssalinas Jun 20, 2017

Choose a reason for hiding this comment

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

Is is possible to write a unit test to prove out this particular case? i.e. what happens if the immediate is first vs the NEW_DEPLOY/TASK_DONE comes first in the queue

Loading

Add test to validate how multiple scheduled requests for the same
request are processed in the queue. In particular, validate that when an
immediate request and a scheduled request make it into the pending queue
at the same time, only the immediate request runs and the pending
request gets dropped.
@ssalinas
Copy link
Member

@ssalinas ssalinas commented Jun 22, 2017

Thanks for adding the test, let's give this one a go in staging

Loading

@ssalinas ssalinas added this to the 0.16.0 milestone Jun 23, 2017
@ssalinas ssalinas added this to the 0.16.0 milestone Jun 23, 2017
@ssalinas ssalinas merged commit d76b12f into master Jun 28, 2017
2 checks passed
Loading
@ssalinas ssalinas deleted the multiple-scheduled-tasks branch Jun 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants