aboutsummaryrefslogtreecommitdiffstats
path: root/worker/specs
diff options
context:
space:
mode:
authorpcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8>2010-11-27 16:48:26 +0000
committerpcarrier <pcarrier@ef72aa8b-4018-0410-8976-d6e080ef94d8>2010-11-27 16:48:26 +0000
commitf48426d52581a064282bdbc3f7920dfda4b3739d (patch)
treec9aeb086148d63704f19a41a0333e2f89f0a9430 /worker/specs
parent74aece56209ee534f89d11c0c8cee00e747359a3 (diff)
downloadsos-f48426d52581a064282bdbc3f7920dfda4b3739d.tar.gz
[worker] Changes in specs, first draft implementation
specs: - s/SIGTERM/SIGINT/ - s/noop/ping/ - new noop command - introduced UNKNOWN COMMAND and INTERRUPTED on stderr - (stdout|stderr) and their lengths are now interleaved in 'exec' output implementation: - Here's a first design git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@1033 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'worker/specs')
-rw-r--r--worker/specs30
1 files changed, 19 insertions, 11 deletions
diff --git a/worker/specs b/worker/specs
index b709fde9..73ed80db 100644
--- a/worker/specs
+++ b/worker/specs
@@ -22,18 +22,20 @@ When gatherer is expected to write in a file, its parent directory should exist
and it will be opened with the "w" flag (unless stated otherwise).
No timeout handling should be implemented in gatherer.
-SIGTERM should be intercepted and:
-- stop the current request and continue the normal flow of execution when a
- request is being handled,
+SIGINT should be handled and:
+- stop the current request, write INTERRUPTED to stderr then continue the normal
+ flow of execution when a request is being handled,
- be treated as an 'exit' request is a command was being read
- be treated as a 'reset' if a command was already read, but the request is
still being read. The current request should be dropped and a new request
should be read, the request counter is not incremented as no request was
processed.
-stderr is only used:
-- by Python, for example to display exceptions.
-- to print "ALIVE" when SIGUSR1 is received or after a "noop" request.
+stderr is used:
+- by Python to display exceptions;
+- to print "ALIVE" when SIGUSR1 is received or after a "ping" request;
+- to print "UNKNOWN COMMAND" when a command is unknown;
+- to print "INTERRUPTED" when a command is interrupted with SIGINT.
Requests
--------
@@ -42,6 +44,14 @@ Command: "noop"
Params:
- None
Action:
+- None
+Returns:
+- Nothing
+
+Command: "ping"
+Params:
+- None
+Action:
- Prints "ALIVE" on stderr
Returns:
- Nothing
@@ -69,12 +79,10 @@ Params:
Action:
- Executes the command in a shell using subprocess.Popen
Returns:
-- On the first line, the return code
-- On the second line, the length of its stdout output as return by len(), in
- decimal.
-- On the third line, the length of its stderr output as return by len(), in
- decimal.
+- The return code of the command
+- The length of its stdout output as return by len(), in decimal.
- Its stdout output, followed by a trailing '\n'
+- The length of its stderr output as return by len(), in decimal.
- Its stderr output, followed by a trailing '\n'
Command: "exec2file"