All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] runner: Use exitcode 127 when resume is impossible
@ 2020-07-21  9:12 Petri Latvala
  2020-07-21  9:12 ` [igt-dev] [PATCH i-g-t 2/2] runner: Print a message when aborting due to IGT_EXIT_ABORT Petri Latvala
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Petri Latvala @ 2020-07-21  9:12 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

igt_resume is typically used in a scripted loop, with automatic
reboots and retries. It already uses separate exit codes for being
done (0), requiring a reboot and a retry (1) and requiring a retry due
to exceeding its overall time quota (2). Introduce another exit code,
127, for circumstances where execution in the given directory is
impossible and retrying would never terminate. One example case is
a kernel bug causing the filesystem to go enough bonkers to make the
runner settings files disappear.

As a drive-by improvement, also print something when that happens.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 runner/resume.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/runner/resume.c b/runner/resume.c
index d5a20e80..f5d69e21 100644
--- a/runner/resume.c
+++ b/runner/resume.c
@@ -28,11 +28,12 @@ int main(int argc, char **argv)
 
 	if ((dirfd = open(argv[1], O_RDONLY | O_DIRECTORY)) < 0) {
 		fprintf(stderr, "Failure opening %s: %s\n", argv[1], strerror(errno));
-		return 1;
+		return 127;
 	}
 
 	if (!initialize_execute_state_from_resume(dirfd, &state, &settings, &job_list)) {
-		return 1;
+		fprintf(stderr, "Failure reading metadata in %s\n", argv[1]);
+		return 127;
 	}
 
 	if (!execute(&state, &settings, &job_list)) {
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-21 12:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21  9:12 [igt-dev] [PATCH i-g-t 1/2] runner: Use exitcode 127 when resume is impossible Petri Latvala
2020-07-21  9:12 ` [igt-dev] [PATCH i-g-t 2/2] runner: Print a message when aborting due to IGT_EXIT_ABORT Petri Latvala
2020-07-21  9:39 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] runner: Use exitcode 127 when resume is impossible Patchwork
2020-07-21 10:37 ` [igt-dev] [PATCH i-g-t 1/2] " Arkadiusz Hiler
2020-07-21 12:53 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/2] " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.