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

Scheduler: don't give tasks to disabled assistants #1839

Merged

Conversation

Tarrasch
Copy link
Contributor

@Tarrasch Tarrasch commented Sep 1, 2016

Description

Previously assistants would keep getting tasks and never stop. Despite
that a user have clicked "disable worker" in the WebUI.

Motivation and Context

This is a bugfix.

Have you tested this? If so, how?

I have included unit tests. I have yet to test in production environment.

@Tarrasch
Copy link
Contributor Author

Tarrasch commented Sep 6, 2016

@daveFNbuck, as the founder of assistants feature. Do you mind reviewing this?

@daveFNbuck
Copy link
Contributor

Won't we need to add worker logic to kill the assistant after this? It's not ideal if the assistant process stays permanently alive after this.

@Tarrasch
Copy link
Contributor Author

Tarrasch commented Sep 6, 2016

Oh. I assumed assistants would break their get_work loop once the scheduler says there's no more tasks. Let me double check this.

@Tarrasch
Copy link
Contributor Author

This PR is yet not done although still sensible to review. I need to add tests that actually disable a worker. The tests I've touched upon so far are about sending interrupts to the worker (only vaguely related).

@Tarrasch
Copy link
Contributor Author

Feels a bit scary adding another thing to get_work. But does it make sense to you @daveFNbuck?

@Tarrasch Tarrasch force-pushed the dont_give_tasks_to_disabled_assistants branch from 2aaa07d to d225121 Compare September 13, 2016 04:48
@daveFNbuck
Copy link
Contributor

Looks good, but it's missing a way to tell the viz about whether the worker is disabled. You can't disable a worker if it doesn't have any pending jobs without that.

@Tarrasch
Copy link
Contributor Author

Really? I thought the visualizer already had this information in full. Because after clicking on the fire extinguisher button, the worker "bar" is greyed out. Eh,, I'll let pics explain this:

before click:

selection_045

after click:

selection_046

@daveFNbuck
Copy link
Contributor

It uses whether the worker has any pending tasks to determine whether to
gray the bar out. If you have an assistant with no pending tasks, the bar
is already grayed out and you won't have the button to kill it.

On Tue, Sep 13, 2016 at 12:05 AM, Arash Rouhani notifications@github.com
wrote:

Really? I thought the visualizer already had this information in full.
Because after clicking on the fire extinguisher button, the worker "bar" is
greyed out. Eh,, I'll let pics explain this:

before click:

[image: selection_045]
https://cloud.githubusercontent.com/assets/294349/18464398/02854994-79bb-11e6-9a59-81c6f78b4a59.png

after click:

[image: selection_046]
https://cloud.githubusercontent.com/assets/294349/18464399/067bfde0-79bb-11e6-96e4-279ad3abaa74.png


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1839 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AB_rbcRU_tmkPK04AlcVw_xOA06L4SM8ks5qpksqgaJpZM4JyZTj
.

@Tarrasch
Copy link
Contributor Author

Oh, put your safety belt on everyone, I'm going to mess around in frontend land then. ^^

Thanks for the clarification @daveFNbuck, I'll try to see where I can get with this.

@daveFNbuck
Copy link
Contributor

I can do it if this part is too unfamiliar for you.

On Tue, Sep 13, 2016 at 9:34 PM, Arash Rouhani notifications@github.com
wrote:

Oh, put your safety belt on everyone, I'm going to mess around in frontend
land then. ^^

Thanks for the clarification @daveFNbuck https://github.com/daveFNbuck,
I'll try to see where I can get with this.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1839 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AB_rbc_op65sV2LI2mUKS3Q1DP7ZtOQDks5qp3lXgaJpZM4JyZTj
.

@Tarrasch
Copy link
Contributor Author

I'll take a stab at it today. If I fail miserably I'll see how we can cooperate :)

@Tarrasch
Copy link
Contributor Author

@daveFNbuck, I've got stuck on the .html templating part. I initially thought we use tornado for html templating (here and here. But it seems like no.

I'm editing luigi/static/visualiser/index.html and I don't see syntax like {% if blah%} but instead it uses {{#var_name}} which doesn't seem to be Tornado's thingie. Confusingly, the html file luigi/templates/layout.html seem to use the tornado syntax.

Can you say what template engine provides {{#var_name}} syntax so I can google for docs?

@daveFNbuck
Copy link
Contributor

I also don't know the answer on that one. I've mostly just tweaked around the edges on what was already there.

@Tarrasch
Copy link
Contributor Author

@freider @erikbern @stephenpascoe, quick question. Do you know what HTML templating syntax luigi's visualiser uses? See the comment above.

@Tarrasch
Copy link
Contributor Author

Tarrasch commented Sep 16, 2016

Ah, luigi is using Mustache as of #80. I'm not sure about what version and stuff though. Triggered by this line of code.

@Tarrasch
Copy link
Contributor Author

Oh boy am I excited after my first line of written javascript!

Mostly unrelated: Kudos to @fabriziodemaria and everyone involved in the recent improvements to the execution summary and return codes. The summary prints exactly what one expects after disabling the worker:

selection_048

Previously assistants would keep getting tasks and never stop. Despite
that a user have clicked "disable worker" in the WebUI.
This is so we scan make the WebUI aware of the state. (upcoming commit)
Previously it was equivalent to "has no pending tasks". But because we
also associate "greyed out" with "can't click disable", the WebUI have
confused at least me for a while.

This is also useful because you can now disable the worker while it's
still in the scheduling phase.
@Tarrasch Tarrasch force-pushed the dont_give_tasks_to_disabled_assistants branch from 24a1bc6 to 0886a23 Compare September 19, 2016 02:29
@Tarrasch
Copy link
Contributor Author

@daveFNbuck, I would appreciate a final round of review. :)

Copy link
Contributor

@daveFNbuck daveFNbuck left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -308,6 +311,9 @@ <h3 class="box-title">{{name}}</h3>
Running: {{num_running}}<br>
Pending: {{num_pending}}<br>
Unique Pending: {{num_uniques}}<br>
{{#is_disabled}}
This worker is <b>disabled</b>. It will not start on new tasks.<br>
Copy link
Contributor

Choose a reason for hiding this comment

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

It will not start new tasks. No "on"

@Tarrasch Tarrasch merged commit cac500a into spotify:master Sep 20, 2016
@Tarrasch Tarrasch deleted the dont_give_tasks_to_disabled_assistants branch September 20, 2016 09:27
This was referenced Jun 29, 2022
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.

2 participants