aboutsummaryrefslogtreecommitdiff
path: root/src/im-sandbox.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-05-24 14:58:25 +0200
committerThomas White <taw@physics.org>2018-05-24 15:00:52 +0200
commit3f8db4b1884a95f4f52e744cb1639df80208381e (patch)
treeeab374546d93ebf33f597e456c171d0fc4fffe9a /src/im-sandbox.c
parent2b9b4cb52775cbc2a7e458fae3a799e0a03f378d (diff)
indexamajig: Warn if a frame takes more than 10 minutes to process
Diffstat (limited to 'src/im-sandbox.c')
-rw-r--r--src/im-sandbox.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/im-sandbox.c b/src/im-sandbox.c
index 09928a82..91479414 100644
--- a/src/im-sandbox.c
+++ b/src/im-sandbox.c
@@ -3,13 +3,13 @@
*
* Sandbox for indexing
*
- * Copyright © 2012-2017 Deutsches Elektronen-Synchrotron DESY,
+ * Copyright © 2012-2018 Deutsches Elektronen-Synchrotron DESY,
* a research centre of the Helmholtz Association.
* Copyright © 2012 Richard Kirian
* Copyright © 2012 Lorenzo Galli
*
* Authors:
- * 2010-2017 Thomas White <taw@physics.org>
+ * 2010-2018 Thomas White <taw@physics.org>
* 2014 Valerio Mariani
* 2011 Richard Kirian
* 2012 Lorenzo Galli
@@ -147,6 +147,16 @@ static void check_hung_workers(struct sandbox *sb)
stamp_response(sb, i);
}
+ if ( tnow - sb->shared->time_last_start[i] > 600 ) {
+ if ( !sb->shared->warned_long_running[i] ) {
+ STATUS("Worker %i has been working on one "
+ "frame for more than 10 minutes.\n", i);
+ STATUS("Event ID is: %s\n",
+ sb->shared->last_ev[i]);
+ sb->shared->warned_long_running[i] = 1;
+ }
+ }
+
}
}
@@ -378,6 +388,7 @@ static void run_work(const struct index_args *iargs, Stream *st,
}
+ sb->shared->time_last_start[cookie] = get_monotonic_seconds();
process_image(iargs, &pargs, st, cookie, tmpdir, ser,
sb->shared, taccs);
@@ -558,6 +569,8 @@ static void start_worker_process(struct sandbox *sb, int slot)
sb->shared->pings[slot] = 0;
sb->last_ping[slot] = 0;
+ sb->shared->time_last_start[slot] = get_monotonic_seconds();
+ sb->shared->warned_long_running[slot] = 0;
p = fork();
if ( p == -1 ) {