Skip to content

Commit

Permalink
add host_jobid to heartbeat and fix block on /search.
Browse files Browse the repository at this point in the history
  • Loading branch information
baallan authored and tom95858 committed Apr 18, 2024
1 parent 2d13b45 commit 6c87bf5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions ldms/src/sampler/netlink/netlink-notifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -2733,7 +2733,9 @@ static int set_jobid_variable(forkstat_t *ft)
* ft->jobid_file_name will remain NULL if user wants no jobid from /var.
* (default is user wants no jobid from /var)
*/
static int set_jobid_file(forkstat_t *ft)
#define SJF_LOOP 0
#define SJF_ONCE 1
static int set_jobid_file(forkstat_t *ft, int once)
{
if (ft->jobid_file_name)
return 0;
Expand All @@ -2760,6 +2762,8 @@ static int set_jobid_file(forkstat_t *ft)
return 0;
}
}
if (once)
return 0;
sleep(JOB_FILES_RETRY);
}
}
Expand All @@ -2779,7 +2783,7 @@ jobid_thread_check(void *arg)
int mask = IN_CLOSE_WRITE | IN_CREATE | IN_DELETE | IN_DELETE_SELF;

// this loops until file is known if file is expected
rc = set_jobid_file(ft);
rc = set_jobid_file(ft, SJF_LOOP);
if (rc) {
printf("out of memory setting job id input file\n");
return NULL;
Expand Down Expand Up @@ -4058,10 +4062,11 @@ void heartbeat(forkstat_t *ft, time_t now, jbuf_t *jbd)
"\"schema\":\"ldms-notify-status\","
"%s%s"
"\"timestamp\":%" PRId64 ","
"\"event\":\"heartbeat\",\"data\":{}}",
"\"event\":\"heartbeat\",\"data\":{\"host_jobid\":\"%s\"}}",
forkstat_get_serial(ft),
ft->prod_field, ft->compid_field,
(int64_t)ft->lastbeat
(int64_t)ft->lastbeat,
ft->host_jobid
);
if (jb) {
send_ldms_message(ft, jb);
Expand Down Expand Up @@ -4348,7 +4353,7 @@ int main(int argc, char * argv[])
}
normalize_exclude(&excludes[c]);
}
int rc = set_jobid_file(ft);
int rc = set_jobid_file(ft, SJF_ONCE);
switch (rc) {
case ENOENT:
fprintf(stderr, "Warning: Found no file for %s with %s.\n",
Expand Down

0 comments on commit 6c87bf5

Please sign in to comment.