Skip to content

Kill and wait #356

@mchitre

Description

@mchitre

When an agent is killed using container.kill(), it is marked as FINISHING and removed from the container. However, its behaviors may still run to completion before shutdown() is called. This means that any resources that the agent frees may take some time to be freed. Restarting the agent immediately, therefore, could lead to failures if it tries to re-acquire resources.

The suggested solution is to have a container.killAndWait() method that gets a handle to the agent, calls container.kill(), and then waits for the agent to finish shutdown(). This can be implemented by a notifyAll() at the end of the shutdown() to allow the caller to block on a condition.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions