[CRIU] [PATCH] dump: wait task stopped for 1 sec
Kinsbursky Stanislav
skinsbursky at openvz.org
Tue Jan 31 07:40:00 EST 2012
From: Stanislav Kinsbursky <skinsbursky at parallels.com>
Wait for 1 sec in case of task is not stopped to dump stage and check it's
state once more.
Should help against this error:
Obtainting task stat ... Error (cr-dump.c:1213): Task in bad state: R
Signed-off-by: Stanislav Kinsbursky <skinsbursky at parallels.com>
---
cr-dump.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/cr-dump.c b/cr-dump.c
index 78d4b9b..af31a89 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -1186,6 +1186,7 @@ static int dump_one_task(struct pstree_item *item, struct cr_fdset *cr_fdset)
int ret = -1;
int pid_dir;
struct parasite_dump_misc misc;
+ int attempt = 0;
pr_info("========================================\n");
pr_info("Dumping task (pid: %d)\n", pid);
@@ -1198,6 +1199,7 @@ static int dump_one_task(struct pstree_item *item, struct cr_fdset *cr_fdset)
}
pr_info("Obtainting task stat ... ");
+retry:
ret = parse_pid_stat(pid, pid_dir, &pps_buf);
if (ret < 0)
goto err;
@@ -1209,6 +1211,11 @@ static int dump_one_task(struct pstree_item *item, struct cr_fdset *cr_fdset)
/* Stopped -- can dump one */
break;
default:
+ if (attempt++ == 0) {
+ sleep(1);
+ pr_err("Trying once more\n");
+ goto retry;
+ }
ret = -1;
pr_err("Task in bad state: %c\n", pps_buf.state);
goto err;
More information about the CRIU
mailing list