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

Conversation

Projects
None yet
2 participants
@PtrTeixeira
Contributor

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

Remove extra scheduled entries from pending queue
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

This comment has been minimized.

@ssalinas

ssalinas Jun 20, 2017

Member

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

@ssalinas

ssalinas Jun 20, 2017

Member

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

Add test for multipe scheduled requests in queue
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

This comment has been minimized.

Show comment
Hide comment
@ssalinas

ssalinas Jun 22, 2017

Member

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

Member

ssalinas commented Jun 22, 2017

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

@ssalinas ssalinas modified the milestone: 0.16.0 Jun 23, 2017

@ssalinas ssalinas merged commit d76b12f into master Jun 28, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@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