Commit 800c4d09 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

seize: add more detailed comment

Why we do several attempts to freeze tasks.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent fc9fea2f
...@@ -769,7 +769,13 @@ static int get_children(struct pstree_item *item) ...@@ -769,7 +769,13 @@ static int get_children(struct pstree_item *item)
ret = seize_task(pid, item->pid.real, &item->pgid, &item->sid); ret = seize_task(pid, item->pid.real, &item->pgid, &item->sid);
if (ret < 0) { if (ret < 0) {
/* Don't worry, will try again on the next attempt */ /*
* Here is a race window between parse_children() and seize(),
* so the task could die for these time.
* Don't worry, will try again on the next attempt. The number
* of attempts is restricted, so it will exit if something
* really wrong.
*/
ret = 0; ret = 0;
xfree(c); xfree(c);
continue; continue;
...@@ -866,8 +872,11 @@ static int seize_threads(struct pstree_item *item, ...@@ -866,8 +872,11 @@ static int seize_threads(struct pstree_item *item,
ret = seize_task(pid, item_ppid(item), NULL, NULL); ret = seize_task(pid, item_ppid(item), NULL, NULL);
if (ret < 0) { if (ret < 0) {
/* /*
* Skip an error, we will try to freeze it again * Here is a race window between parse_threads() and seize(),
* on the next attempt. * so the task could die for these time.
* Don't worry, will try again on the next attempt. The number
* of attempts is restricted, so it will exit if something
* really wrong.
*/ */
continue; continue;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment