Skip to content

Commit 3a79643

Browse files
authored
Merge pull request #5850 from garlick/job_list_cleanup
minor cleanup in job-manager journal and job-list (mostly inline docs)
2 parents 4598d41 + b47b3c9 commit 3a79643

File tree

4 files changed

+34
-12
lines changed

4 files changed

+34
-12
lines changed

src/modules/job-list/job_state.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -982,11 +982,9 @@ static int journal_process_event (struct job_state_ctx *jsctx,
982982
return -1;
983983
}
984984
else if (streq (name, "flux-restart")) {
985-
/* Presently, job-list depends on job-manager.events-journal
986-
* service. So if job-manager reloads, job-list must be
987-
* reloaded, making the probability of reaching this
988-
* `flux-restart` path very low. Code added for completeness
989-
* and in case dependency removed in the future.
985+
/* This can only be seen while processing the journal backlog
986+
* as it is posted by the job manager during its KVS restart,
987+
* which happens synchronously before the journal RPC is processed.
990988
*/
991989
if (journal_revert_job (jsctx,
992990
job,

src/modules/job-manager/event.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ enum job_manager_event_flags {
2222

2323
/* EVENT_NO_COMMIT events are the same as any other event, except
2424
* that the event is not posted to the job eventlog in the KVS.
25-
* The event is not given a global sequence number, since this would
26-
* cause the events to be numbered incorrectly when replayed from
27-
* the eventlog in the KVS.
2825
*/
2926
EVENT_NO_COMMIT = 1,
3027
};

src/modules/job-manager/journal.c

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,36 @@
88
* SPDX-License-Identifier: LGPL-3.0
99
\************************************************************/
1010

11-
/* journal.c - job event journaling and streaming to listeners
11+
/* journal.c - stream job events
12+
*
13+
* This allows another service to track detailed information about
14+
* all jobs. The journal consumer makes a job-manger.events-journal
15+
* request with optional allow/deny filter and boolean 'full' flag:
16+
* {"full"?b, "allow"?{"name":1, ...}, "deny"?{"name:1, ...}}
17+
*
18+
* If "full" is true, the journal begins with all the inactive jobs.
19+
* If "full" is false, the journal begins with all the active jobs.
20+
* If "full" is unspecified, it is assumed to be false.
21+
* If allow/deny rules are specified, they filter the job events by name.
22+
*
23+
* The journal consumer receives a stream of responses until the job
24+
* manager is unloaded or the request is canceled. Each response consists of
25+
* an object containing a jobid, an array of events, and optional data:
26+
* {"id":I, "events":[], "jobspec"?s, "R"?s}
27+
*
28+
* During processing of the initial backlog, the events array will contain
29+
* all the events posted so far for each job, plus R and jobspec if available.
30+
* The jobs are returned in hash traversal order. Once backlog processing
31+
* is complete, a sentinel response is transmitted with id of FLUX_JOBID_ANY
32+
* and an empty events array:
33+
* {"id":-1, "events":[]}
34+
*
35+
* The sentinel informs the consumer that it is now caught up and that future
36+
* responses will be for events that are are posted in real time.
37+
*
38+
* Additional responses contain at most one event. The redacted jobspec is
39+
* included with the "validate" event. The redacted R object is included
40+
* with the "alloc" event.
1241
*/
1342

1443
#if HAVE_CONFIG_H
@@ -29,8 +58,6 @@
2958
#include "job.h"
3059
#include "journal.h"
3160

32-
#define DEFAULT_JOURNAL_SIZE_LIMIT 1000
33-
3461
struct journal {
3562
struct job_manager *ctx;
3663
flux_msg_handler_t **handlers;

src/modules/job-manager/prioritize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static int reprioritize_one (struct job_manager *ctx,
9898
&& job->state != FLUX_JOB_STATE_PRIORITY
9999
&& job->priority != FLUX_JOB_PRIORITY_MIN
100100
&& job->priority != FLUX_JOB_PRIORITY_MAX)
101-
flags = EVENT_JOURNAL_ONLY;
101+
flags = EVENT_NO_COMMIT;
102102
*/
103103

104104
/* Post 'priority' event.

0 commit comments

Comments
 (0)