Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle Instance Task's creation errors
When instance manager starts and runs an Instance Task, it sets up a pipe between parent and child and also adds the parents pipe FD's to boost asio. Creation of pipe and assigning the pipe fd to boost can result in errors. These errorrs are not handled in instance manager. This is resulting in error scenarios where complete instance task is not setup but instance manager acts on it, which results in crashes. As a fix, following behaviour is added. 1) If creation of pipe fails, task's "is_running" is set to false and is not moved out of task_queue. Using a timer, it is attempted two more times to start it. If task still fails to start after fixed number of attempts, then task is deleted. 2) If child process successfully starts(and pid is available) but assigning the fd to boost fails, "is_running" is set to true and instance manager waits for netns_timeout_ time to delete this task rather relying on pipe event. In this case, child process very likely succeeds the execution but as pipe event is no more tracked, max time of netns_timeout_ time is waited to delete the task. 3) The stale netns in host machines (if agent restarts) are deleted directly rather relying on task_queue infrastructure to make sure stale tasks are not at head of task_queue. partial-bug: #1527429 (cherry picked from commit 6bc6a42) Conflicts: src/vnsw/agent/oper/instance_manager.cc src/vnsw/agent/oper/instance_task.h Change-Id: Ifd4cacce42e8fc6136cf15a9c82e678ad3b1ea9e (cherry picked from commit e4b3216)
- Loading branch information
1 parent
c5866f5
commit f9edeba
Showing
4 changed files
with
111 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters