Skip to content
This repository was archived by the owner on Jan 5, 2019. It is now read-only.

Conversation

@jonasfj
Copy link
Contributor

@jonasfj jonasfj commented Mar 1, 2016

Work in progress adding task.dependencies and task.dependencyRelation.

At this stage I need to write tests... try to actually run the code and fix all the bugs that comes up :)

But it's also a decent time to start review for sanity...
I'm fairly confident I've designed it such that a crash anytime during createTask, doesn't prevent the same createTask call from succeeding if retried later... It's hard to get the idempotency correct, but I think it's sane... please have a look.

routes/v1.js Outdated

// Ensure we have a self-dependency, this is how defineTask works now
if (!_.includes(taskDef.dependencies, taskId)) {
taskDef.dependencies.push(taskId);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@imbstack, so funny/scary story, this created a problem because our current validator just sets the default value from the json-schema without making a clone.

Hence, by doing dependencies.push(... I actually modified the default value inside the validator.

@imbstack
Copy link
Contributor

imbstack commented Mar 4, 2016

I'm reading this today, I swear.


// Try to create Task entity
try {
let runs = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

A note for myself for later (this may be wrong): It looks like we always create tasks no matter whether or not they're ready to run. runs will just be empty until they're ready to actually run.

@imbstack
Copy link
Contributor

imbstack commented Mar 4, 2016

I'm about 3/4 way through reviewing this. Just thought that it might be a good idea to get the sentry-catches-crashes thing in here before this is shipped and rebase this on top of that change. It could save us a good bit of sadness down the road. What do you think?

@@ -1,5 +1,5 @@
var base = require('taskcluster-base');
var debug = require('debug')('queue:data');
var debug = require('debug')('app');
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@imbstack
Copy link
Contributor

imbstack commented Mar 4, 2016

Ok, I've read this. I want to spend some more time with it, but it seems pretty good.

@jonasfj
Copy link
Contributor Author

jonasfj commented Mar 17, 2016

@imbstack, I think this is now done with tests and everything...

@jonasfj jonasfj changed the title [WIP] task.dependencies ** DO NOT MERGE** [task.dependencies Mar 17, 2016
@jonasfj jonasfj changed the title [task.dependencies task.dependencies Mar 17, 2016
@jonasfj
Copy link
Contributor Author

jonasfj commented Mar 17, 2016

@jhford you are also invited to have a look around :)

* }
*/
constructor(options = {}) {
assert(options, 'options are required');
Copy link
Contributor

Choose a reason for hiding this comment

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

😆

await this.dependencyTracker.resolveTask(m.taskId, m.resolution);
await m.remove();
} catch (err) {
debug("[alert-operator] Failed to handle message: %j" +
Copy link
Contributor

Choose a reason for hiding this comment

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

I wish we had logging levels.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or reporting to sentry... Which seems like the better option here...

@imbstack
Copy link
Contributor

I think I'd still like to get the sentry exception handling stuff in here before this ships, but that's not necessary.

r+ looks great to me.

"scope-pattern": "^[\\x20-\\x7e]*$",

// Maximum number of dependencies a single task can have
"max-task-dependencies": 100,
Copy link
Contributor

Choose a reason for hiding this comment

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

why did we pick 100?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was a prettt round number :)

Obviously there is some limit, I don't know what it is... But 100 should serve most use-cases and force intermediate dummy tasks in the edge cases...

@jhford
Copy link
Contributor

jhford commented Mar 18, 2016

Did a once-over of this and it looks good. I'm a little curious about why we have the limit of dependent tasks at 100, but i get that we do want some sort of limit.

@jonasfj jonasfj merged commit f0c1a00 into master Mar 22, 2016
@jonasfj jonasfj deleted the task-deps branch March 22, 2016 21:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants