-
Notifications
You must be signed in to change notification settings - Fork 160
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
Disallow saving bad DAGs #77
Comments
Do you think the check should happen at the add-dependency level (ie as soon as you create a cycle when adding a dependency, it fails to save it) or when saving the whole DAG? (or both) |
I did some thinking on this last week and realized that there are a few complications here. tl;dr: We need to implement a better consistency model before we can disallow saving bad DAGs. I'll go create an issue for that. First, some facts:
Atomic updates will not be sufficient if we are going to disallow saving bad DAGs. This is what the interaction will look like:
Dagobah's consistency model is already bad, but this was mitigated partially by the nature of atomic updating. I'm not comfortable with full-DAG POSTs unless we have a better consistency model. Once we have a consistency model, this method should be fine. |
In step 3, what is wrong with removing the dependency when the server rejects it? Or not updating the front end model until the server has confirmed it's validity? |
You don't want to remove the dependency from the front-end because the user purposefully put it there. She's probably in the process of making some more changes to make the DAG valid again. Refusing to save the incremental changes along the way could be very annoying. |
I mean, is it that much of a problem to ask them to fix the cycle before allowing them to add that connection? What about turning that arrow red (or something) in the front end? |
That would be possible, though we would then need to maintain some sort of sync queue in the frontend with changes that have been made in the browser but not successfully saved on the server. We would then need to try to sync everything in the queue whenever something else is changed. This could probably be made easier by having some DAG validation logic in the frontend as well. This does seem like it might be simpler. I think that approach is safer and could be merged before the consistency model, though I still want to add that in at some point. |
I just don't see what's so bad about disallowing adding a dependency if there's a cycle, how often would this case happen? And wouldn't immediate feedback be useful? |
I suppose it won't be all that annoying, since the only action that could cause an inconsistency is adding an edge. It would be more annoying if a node addition/deletion got backed out, but that won't happen. Yeah, we can do it that way. So basically:
|
Yeah, that was my thought process. Although #88 is a nice-to-have for potential simultaneous editing. The other issue is if we do put in a PR for this, if users upgrade, it wont detect any existing cyclic DAGs, but I guess that would mean they're not in use anyway because they won't run with cycles. |
From a discussion on #60. Currently, it's possible to save a Job when its DAG has cycles. Let's disallow this and update the UI to not be as annoying about it when a cycle is created.
The text was updated successfully, but these errors were encountered: