Skip to content

Commit

Permalink
add debug log for WorkerService remainder/claim freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
voxparcxls committed Feb 7, 2024
1 parent ae9394d commit 19aee99
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,13 @@ public int getCountForClaimedProcInstPerKey(String procDefKey, List<String> clai
return jdbcTemplate.queryForObject(query, Integer.class);
}

public List<Map<String, Object>> getProcDefKeyLatestCompleteInst(String procDefKey) {
return jdbcTemplate.queryForList(
"SELECT proc_inst_id, start_time, end_time FROM cws_proc_inst_status WHERE proc_def_key=? AND status='complete' ORDER BY start_time DESC LIMIT 1",
new Object[]{procDefKey}
);
}


public String getProcDefKeyFromUuid(String uuid) {
String query = "SELECT proc_def_key FROM cws_sched_worker_proc_inst " + "WHERE uuid='" + uuid + "'";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,13 @@ public List<Map<String,Object>> claimWithCounter(String limitToProcDefKey) {
"(remainders = " + remainders +
", procMaxNumbers = " + workerMaxProcInstances.entrySet() +
", currentCounts = " + currentCounts + ")");

for (Entry<String,Integer> entry : remainders.entrySet()) {
List<Map<String, Object>> lastCompleteProcInst = schedulerDbService.getProcDefKeyLatestCompleteInst(entry.getKey().toString());
if (lastCompleteProcInst.size() > 0) {
log.debug("Last completed process instance for procDefKey '" + entry.getKey().toString() + "': " + lastCompleteProcInst);
}
}
}


Expand Down

0 comments on commit 19aee99

Please sign in to comment.