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

Add /queued/ API #42

Merged
merged 3 commits into from Aug 5, 2014
Merged

Add /queued/ API #42

merged 3 commits into from Aug 5, 2014

Conversation

zmc
Copy link
Member

@zmc zmc commented Jun 24, 2014

Returns a list of runs that have any queued jobs

Signed-off-by: Zack Cerza zack.cerza@inktank.com

run_names = set([item[0] for item in query if item[0]])
runs = Run.query.filter(Run.name.in_(sorted(run_names))).order_by(
Run.scheduled)
return runs.all()
Copy link
Contributor

Choose a reason for hiding this comment

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

are we ever going to have the possibility of a gazillion jobs queued? because then this would become really expensive

Copy link
Member Author

Choose a reason for hiding this comment

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

Ugh you're right. Let me see if I can find a faster way. I think I was overcaffeinated yesterday and entered the dreaded "just make it work" mode.

zmc and others added 3 commits August 4, 2014 14:49
Returns a list of runs that have any queued jobs

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
@@ -3,7 +3,7 @@
from sqlalchemy import Date, cast

from pecan import abort, conf, expose, request
from paddles.models import Run, rollback
from paddles.models import Job, Run, rollback, Session
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not specific to this changeset, but rollback is not being used correctly in this module. I opened http://tracker.ceph.com/issues/9010 so this can be tracked and fixed.

Copy link
Member Author

Choose a reason for hiding this comment

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

I put those rollbacks there when I was constantly hitting deadlocks whose exceptions specifically told me the transaction needed to be rolled back. It may be safe to remove them now, but I'm not doing it in this PR...

alfredodeza added a commit that referenced this pull request Aug 5, 2014
@alfredodeza alfredodeza merged commit 65c73d3 into master Aug 5, 2014
@zmc zmc deleted the queue-view branch August 5, 2014 19:19
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.

None yet

2 participants