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

Wait for Actor Start message to be processed before returning workflo… #308

Merged
merged 2 commits into from Dec 4, 2015

Conversation

Horneth
Copy link
Contributor

@Horneth Horneth commented Dec 1, 2015

…w ID

@@ -320,6 +320,8 @@ case class WorkflowActor(workflow: WorkflowDescriptor, backend: Backend)
case Failure(t) =>
self ! AsyncFailure(t)
}

futureCaches
Copy link
Contributor

Choose a reason for hiding this comment

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

These caches represent sensitive internal WorkflowActor data that the sender() shouldn't have access to. It might be preferable to have the return type be Future[Unit] and return futureCaches map { _ => () } (or some other nicer way of throwing away the Future success value).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good catch !

@mcovarr
Copy link
Contributor

mcovarr commented Dec 1, 2015

👍 nice apart from the one gripe 😄

@mcovarr
Copy link
Contributor

mcovarr commented Dec 3, 2015

I don't think it should be part of this ticket, but if we wanted to support a higher request rate we could just generate a UUID and a persist a shell of a workflow execution without doing all the heavy lifting we do now before persisting.

@kshakir
Copy link
Contributor

kshakir commented Dec 3, 2015

This passes the K.I.S.S. principle, but I personally hate the ask pattern, as it leads to timeouts and exceptions when the system gets busy. One should be theoretically be able to have the two actors to tell / receive messages instead, though I don't have the code ready at this second.

@Horneth
Copy link
Contributor Author

Horneth commented Dec 4, 2015

@mcovarr I think we still need to ensure that the submission is correct before sending back a 201 with the workflow ID, which means being sure that everything necessary to start executing the workflow is ready (all DB executions succeeded etc...)
@kshakir I see your point, however in this case I don't think having the ask timing out is a problem, if a WorkflowActor takes forever to initialize itself then there is actually some bottleneck further down, and it might even be better to say "sorry but we're really too busy right now, retry later", than keeping waiting for WorkflowActors, which is going to trigger a timeout anyway since this comes from the "submit endpoint" and spray is not going to wait forever either.

@kshakir
Copy link
Contributor

kshakir commented Dec 4, 2015

Discussed offline 👍 for this PR, with another to be added to prioritize if we want to remove the ask pattern.

@kshakir kshakir assigned Horneth and unassigned kshakir Dec 4, 2015
Horneth added a commit that referenced this pull request Dec 4, 2015
Wait for Actor Start message to be processed before returning workflo…
@Horneth Horneth merged commit ebaace1 into develop Dec 4, 2015
@Horneth
Copy link
Contributor Author

Horneth commented Dec 4, 2015

Created a tech debt ticket as per discussed with @kshakir and @mcovarr https://broadinstitute.atlassian.net/browse/DSDEEPB-2214

@mcovarr mcovarr deleted the tj_WorkflowIDPersistence branch December 9, 2015 15:33
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

3 participants