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

Get rid of async package & remove unused runner interfaces #544

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ryancouto
Copy link
Contributor

we don't need them!

Copy link
Contributor

@dgassaway dgassaway left a comment

Choose a reason for hiding this comment

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

There is a significant behavior change here from changing the async callback portions to execute at a specific part in the sched step loop, to happening immediately after the async function portion completes. This could have performance implications and these modify the inProgressJobs struct which has no concurrency protection (and could be in the middle of e.g. task schedule and assignment). From a purely "refactor" perspective it would be good to preserve the async ProcessMessages functionality in some way to keep processing behavior as-is.

if err != nil {
return nil, runner.ServiceStatus{}, err
}
st, err = runners.StatusesRO(st).QueryNow(q)
return st, svc, err
}

func (c *simpleClient) Query(q runner.Query, w runner.Wait) ([]runner.RunStatus, runner.ServiceStatus, error) {
// TODO: implement
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops - had to add this to collapse the StatusQueryNower iface into the StatusQuerier, even though we don't use this. Meant to add a better comment.

@JeanetteBruno
Copy link
Contributor

I agree with Drew's comment (keep processing the tasks' results as a specific action in the loop). I was expecting the changes to be along the following lines:

  • create a scheduler/server/task_handler package
  • move task_runner.go to task_handler
  • AsyncError object renamed to taskResult and moved to taskRunner
  • mailbox renamed to resultsCollector and moved to taskRunner
  • runner can actually stay as runner moved to taskRunner
  • the anonymous callback fn in stateful_scheduler.go also be moved into task_handler/

we can attack cleaning up the worker api implementation (Controller, Reader, StatusQuerier, QuerierNow, etc.) at a later date.

@dgassaway
Copy link
Contributor

For the record, I'm totally on board with the worker api simplification in this diff. IF it does not cause breaking API changes, i.e. when this lands we cannot redeploy scoot components safely without additional changes.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ ryancouto
❌ rcouto


rcouto seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants