[CRIU] [PATCH] seize: add more detailed comment

Andrey Vagin avagin at openvz.org
Fri Dec 20 04:35:10 PST 2013


Why we do several attempts to freeze tasks.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-dump.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/cr-dump.c b/cr-dump.c
index 275a0fe..6685c1f 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -769,7 +769,13 @@ static int get_children(struct pstree_item *item)
 
 		ret = seize_task(pid, item->pid.real, &item->pgid, &item->sid);
 		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;
 			xfree(c);
 			continue;
@@ -866,8 +872,11 @@ static int seize_threads(struct pstree_item *item,
 		ret = seize_task(pid, item_ppid(item), NULL, NULL);
 		if (ret < 0) {
 			/*
-			 * Skip an error, we will try to freeze it again
-			 * on the next attempt.
+			 * Here is a race window between parse_threads() 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.
 			 */
 			continue;
 		}
-- 
1.8.3.1



More information about the CRIU mailing list