Skip to content

Commit

Permalink
Added debug/warning logs to identify the 'no steps to execute' issue. #…
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-joshi authored Dec 9, 2022
1 parent 3ee5325 commit 315d286
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions job.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ int Job::Execute()

if (!steps)
{
LogMessage("No steps found for jobid " + m_jobid, LOG_WARNING);
m_status = "i";
return -1;
}
Expand All @@ -110,13 +111,17 @@ int Job::Execute()
" FROM pgagent.pga_jobstep WHERE jstid=" + stepid);

if (res)
{
rc = res->RowsAffected();
LogMessage("Number of rows affected for jobid " + m_jobid, LOG_DEBUG);
}
else
rc = -1;
}

if (rc != 1)
{
LogMessage("Value of rc is " + std::to_string(rc) + " for job " + m_jobid, LOG_WARNING);
m_status = "i";
return -1;
}
Expand Down Expand Up @@ -380,6 +385,7 @@ int Job::Execute()
default:
{
output = "Invalid step type!";
LogMessage("Invalid step type!", LOG_WARNING);
m_status = "i";
return -1;
}
Expand Down Expand Up @@ -437,6 +443,9 @@ void JobThread::operator()()
}
else
{
LogMessage("Failed to launch the thread for job " + m_jobid +
". Inserting an entry to the joblog table with status 'i'", LOG_WARNING);

// Failed to launch the thread. Insert an entry with
// "internal error" status in the joblog table, to leave
// a trace of fact that we tried to launch the job.
Expand Down

0 comments on commit 315d286

Please sign in to comment.