Skip to content

Commit d7df22e

Browse files
James WoodJames Wood
authored andcommitted
Merge branch 'develop'
2 parents 979e84a + c7da037 commit d7df22e

File tree

401 files changed

+26236
-265032
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

401 files changed

+26236
-265032
lines changed

.github/workflows/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ The `publish-cws-image` job is the CD component of the workflow, triggered upon
2222

2323
- [**Services**](https://docs.github.com/en/actions/using-containerized-services/about-service-containers):
2424
- MariaDB
25-
- Image: mariadb:10.6
25+
- Image: mariadb:10.11
2626
- Ports: 3306:3306
2727
- [**checkout**](https://github.com/marketplace/actions/checkout): This action checks out the repository under `$GITHUB_WORKSPACE`, so the workflow can access it.
28-
- Set up JDK 11:
28+
- Set up JDK 17:
2929
- [**setup-java**](https://github.com/marketplace/actions/setup-java-jdk): This action downloads and sets up a requested version of Java
3030
- Current configuration:
31-
- Java-version: 11
31+
- Java-version: 17
3232
- Distribution: Temurin
3333
- Cache: Maven
3434
- **Create open-source certs**:
@@ -87,7 +87,7 @@ The `publish-cws-image` job is the CD component of the workflow, triggered upon
8787
- **Check out the repo**:
8888
- Utilizes the same `checkout` action to check out the repository again
8989
- This is done in a new GitHub runner
90-
- **Set up JDK 11**
90+
- **Set up JDK 17**
9191
- Utilizes the same `setup-java` action to set up Java
9292
- **Log in to Docker Hub**:
9393
- [**Docker Login**](https://github.com/marketplace/actions/docker-login): This action is used to log in against a Docker registry

.github/workflows/camunda.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
services:
2323
mdb106:
24-
image: mariadb:10.6
24+
image: mariadb:10.11
2525
ports:
2626
- 3306:3306
2727
env:
@@ -155,7 +155,7 @@ jobs:
155155

156156
services:
157157
mdb106:
158-
image: mariadb:10.6
158+
image: mariadb:10.11
159159
ports:
160160
- 3306:3306
161161
env:

.github/workflows/ldap.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
services:
2323
mdb106:
24-
image: mariadb:10.6
24+
image: mariadb:10.11
2525
ports:
2626
- 3306:3306
2727
env:

cws-adaptation-engine/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
55
<artifactId>common-workflow-service</artifactId>
6-
<version>2.6.0</version><!-- update this each CWS release -->
6+
<version>2.7.0</version><!-- update this each CWS release -->
77
</parent>
88
<artifactId>cws-adaptation-engine</artifactId>
99

cws-adaptation/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
55
<artifactId>common-workflow-service</artifactId>
6-
<version>2.6.0</version><!-- update this each CWS release -->
6+
<version>2.7.0</version><!-- update this each CWS release -->
77
</parent>
88
<artifactId>cws-adaptation</artifactId>
99

cws-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
55
<artifactId>common-workflow-service</artifactId>
6-
<version>2.6.0</version><!-- update this each CWS release -->
6+
<version>2.7.0</version><!-- update this each CWS release -->
77
</parent>
88
<artifactId>cws-core</artifactId>
99

cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java

Lines changed: 514 additions & 111 deletions
Large diffs are not rendered by default.

cws-engine-service/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
55
<artifactId>common-workflow-service</artifactId>
6-
<version>2.6.0</version><!-- update this each CWS release -->
6+
<version>2.7.0</version><!-- update this each CWS release -->
77
</parent>
88
<artifactId>cws-engine-service</artifactId>
99

cws-engine-service/src/main/java/jpl/cws/engine/WorkerService.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public void initProcessCountersAndLimits() {
190190

191191
log.debug("AFTER INIT: limits: " + workerMaxProcInstances + ", counts: " + processCounters);
192192
}
193-
193+
194194

195195
public void updateStats() {
196196

@@ -690,8 +690,17 @@ public List<Map<String,Object>> claimWithCounter(String limitToProcDefKey) {
690690
continue;
691691
}
692692

693-
currentCounts.put(procDefKey, processCounters.get(procDefKey));
694-
remainders.put(procDefKey, procMaxNumber - currentCounts.get(procDefKey));
693+
// Get current count from both local counter and global database count
694+
int localCount = processCounters.get(procDefKey);
695+
696+
// Query database for global count of running instances across all workers
697+
int globalCount = schedulerDbService.countRunningProcInstances(procDefKey);
698+
699+
// Use the higher of the two counts to ensure limits are respected
700+
int effectiveCount = Math.max(localCount, globalCount);
701+
702+
currentCounts.put(procDefKey, effectiveCount);
703+
remainders.put(procDefKey, procMaxNumber - effectiveCount);
695704
queryLimitForProcSet.put(procDefKey, Math.min(EXEC_SERVICE_MAX_POOL_SIZE, remainders.get(procDefKey)));
696705

697706
//log.trace("getting currentCount for procDefKey " + procDefKey);
@@ -1073,4 +1082,8 @@ public void bringWorkerDown() {
10731082
public String getWorkerId() {
10741083
return workerId;
10751084
}
1076-
}
1085+
1086+
public SchedulerDbService getSchedulerDbService() {
1087+
return schedulerDbService;
1088+
}
1089+
}

cws-engine-service/src/main/java/jpl/cws/engine/listener/ProcessEventListener.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,22 @@ public void run() {
6767
}
6868

6969
if (eventType.equals("processEndEventDetected")) {
70+
// First make sure the database status is updated to COMPLETE
71+
workerService.getSchedulerDbService().markProcessInstanceComplete(uuid);
72+
73+
// Then update local worker state if this worker started it
7074
boolean endedOnThisWorker =
7175
workerService.processEndedActions(procDefKey, uuid);
76+
77+
// Always trigger new process start attempts regardless of which worker handled it
78+
// This ensures a fresh claim attempt happens when any process completes
79+
workerService.procStartReqAction(null, "processEndEventDetected message received");
80+
81+
// Log if this was our process or handled by another worker
7282
if (endedOnThisWorker) {
73-
workerService.procStartReqAction(null, "processEndEventDetected message received");
83+
log.debug("Process " + uuid + " ended on this worker, local counters updated");
84+
} else {
85+
log.debug("Process " + uuid + " ended on another worker, attempting to start pending processes");
7486
}
7587
}
7688
else if (eventType.equals("sync")) {

0 commit comments

Comments
 (0)