fix(controller): job.c TRACE lines print human-readable jobid (bug-1588)
fmt_jobid() renders the raw idgen()-packed jobid in the same cluster-apiserver-timestamp-sequence form already used everywhere else this codebase logs/displays a jobid (scheduler.c/handler.c, worker's process_manager.c, xcecli, waldump). job.c's own TRACE lines were the one place still printing the raw 64-bit packed integer.
This commit is contained in:
parent
70fe9e463b
commit
515f4ca098
1 changed files with 37 additions and 8 deletions
|
|
@ -837,8 +837,16 @@ static int dispatch_a_job_(cluster_t* c, endpoint_t* ep, xce_job_alloc_t* alloc)
|
|||
int nc;
|
||||
xce_job_exec_t einfo;
|
||||
xce_launch_t launchinfo;
|
||||
char jobidStr[64];
|
||||
|
||||
TRACE("%s jobid %ld", __func__, alloc->jobid);
|
||||
/* bug-1588: fmt_jobid() renders the raw idgen()-packed jobid in the
|
||||
* same human-readable "cluster-apiserver-timestamp-sequence" form
|
||||
* already used everywhere else this codebase logs/displays a jobid
|
||||
* (scheduler.c/handler.c/worker's process_manager.c, xcecli's job
|
||||
* listing, waldump) -- job.c's own TRACE lines were the one place
|
||||
* still printing the raw 64-bit packed integer. */
|
||||
fmt_jobid(jobidStr, sizeof(jobidStr), alloc->jobid);
|
||||
TRACE("%s jobid %s", __func__, jobidStr);
|
||||
|
||||
lock(c->jobmgr, RTTI_LOCK_READ);
|
||||
rc = key_find(c->jobmgr, (void*)alloc->jobid, (void**)&j);
|
||||
|
|
@ -1658,8 +1666,11 @@ int on_job_start(cluster_t* c, job_pidinfo_t* info)
|
|||
{
|
||||
job_t* job = NULL;
|
||||
int rc;
|
||||
char jobidStr[64];
|
||||
|
||||
TRACE("%s jobid %ld", __func__, info->jobid);
|
||||
/* bug-1588: see dispatch_a_job_()'s own comment on fmt_jobid(). */
|
||||
fmt_jobid(jobidStr, sizeof(jobidStr), info->jobid);
|
||||
TRACE("%s jobid %s", __func__, jobidStr);
|
||||
|
||||
lock(c->jobmgr, RTTI_LOCK_READ);
|
||||
rc = key_find(c->jobmgr, (void*)info->jobid, (void**)&job);
|
||||
|
|
@ -1762,8 +1773,11 @@ static int record_job_finish_fact(cluster_t* c, job_t* job,
|
|||
int on_job_finish(cluster_t* c, xce_jobfinish_t* finish)
|
||||
{
|
||||
job_t* job = NULL;
|
||||
char jobidStr[64];
|
||||
|
||||
TRACE("%s job finish jobid %ld exit code %d", __func__, finish->jobid,
|
||||
/* bug-1588: see dispatch_a_job_()'s own comment on fmt_jobid(). */
|
||||
fmt_jobid(jobidStr, sizeof(jobidStr), finish->jobid);
|
||||
TRACE("%s job finish jobid %s exit code %d", __func__, jobidStr,
|
||||
finish->exit_code);
|
||||
|
||||
lock(c->jobmgr, RTTI_LOCK_READ);
|
||||
|
|
@ -2022,8 +2036,11 @@ static int record_job_postdone_fact(cluster_t* c, job_t* job)
|
|||
int on_job_fail(cluster_t* c, job_failinfo_t* failinfo)
|
||||
{
|
||||
job_t* job = NULL;
|
||||
char jobidStr[64];
|
||||
|
||||
TRACE("%s job fail jobid %ld code %d", __func__, failinfo->jobid,
|
||||
/* bug-1588: see dispatch_a_job_()'s own comment on fmt_jobid(). */
|
||||
fmt_jobid(jobidStr, sizeof(jobidStr), failinfo->jobid);
|
||||
TRACE("%s job fail jobid %s code %d", __func__, jobidStr,
|
||||
failinfo->code);
|
||||
|
||||
lock(c->jobmgr, RTTI_LOCK_READ);
|
||||
|
|
@ -2051,8 +2068,11 @@ int on_job_stop(cluster_t* c, uint64_t jobid)
|
|||
{
|
||||
job_t* job = NULL;
|
||||
int state;
|
||||
char jobidStr[64];
|
||||
|
||||
TRACE("%s job stop jobid %ld", __func__, jobid);
|
||||
/* bug-1588: see dispatch_a_job_()'s own comment on fmt_jobid(). */
|
||||
fmt_jobid(jobidStr, sizeof(jobidStr), jobid);
|
||||
TRACE("%s job stop jobid %s", __func__, jobidStr);
|
||||
|
||||
lock(c->jobmgr, RTTI_LOCK_READ);
|
||||
key_find(c->jobmgr, (void*)jobid, (void**)&job);
|
||||
|
|
@ -2086,8 +2106,11 @@ int on_job_resume(cluster_t* c, uint64_t jobid)
|
|||
{
|
||||
job_t* job = NULL;
|
||||
int state;
|
||||
char jobidStr[64];
|
||||
|
||||
TRACE("%s job resume jobid %ld", __func__, jobid);
|
||||
/* bug-1588: see dispatch_a_job_()'s own comment on fmt_jobid(). */
|
||||
fmt_jobid(jobidStr, sizeof(jobidStr), jobid);
|
||||
TRACE("%s job resume jobid %s", __func__, jobidStr);
|
||||
|
||||
lock(c->jobmgr, RTTI_LOCK_READ);
|
||||
key_find(c->jobmgr, (void*)jobid, (void**)&job);
|
||||
|
|
@ -2119,8 +2142,11 @@ int on_job_resume(cluster_t* c, uint64_t jobid)
|
|||
int on_job_postdone(cluster_t* c, endpoint_t* ep, uint64_t jobid)
|
||||
{
|
||||
job_t* job = NULL;
|
||||
char jobidStr[64];
|
||||
|
||||
TRACE("%s job post done jobid %ld", __func__, jobid);
|
||||
/* bug-1588: see dispatch_a_job_()'s own comment on fmt_jobid(). */
|
||||
fmt_jobid(jobidStr, sizeof(jobidStr), jobid);
|
||||
TRACE("%s job post done jobid %s", __func__, jobidStr);
|
||||
|
||||
lock(c->jobmgr, RTTI_LOCK_READ);
|
||||
key_find(c->jobmgr, (void*)jobid, (void**)&job);
|
||||
|
|
@ -2293,8 +2319,11 @@ static int set_preason(cluster_t* c, xce_pendreason_t* reasons)
|
|||
{
|
||||
job_t* j = NULL;
|
||||
xce_job_t* job = NULL;
|
||||
char jobidStr[64];
|
||||
|
||||
TRACE("%s jobid %ld", __func__, reasons->jobid);
|
||||
/* bug-1588: see dispatch_a_job_()'s own comment on fmt_jobid(). */
|
||||
fmt_jobid(jobidStr, sizeof(jobidStr), reasons->jobid);
|
||||
TRACE("%s jobid %s", __func__, jobidStr);
|
||||
|
||||
lock(c->jobmgr, RTTI_LOCK_READ);
|
||||
key_find(c->jobmgr, (void*)reasons->jobid, (void**)&j);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue