Skip to content

Commit

Permalink
Merge pull request #755 from folio-org/release_7.0.2
Browse files Browse the repository at this point in the history
Release 7.0.2
  • Loading branch information
EthanFreestone authored Apr 26, 2024
2 parents 879f1ee + dcf9639 commit 81a1610
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 21 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 7.0.2 2024-04-26
* ERM-3190 DB Connections are not being released
* Transactional annotations were being ignored, refactored JobRunnerService to properly set up necessary transactions

## 7.0.1 2024-04-17
* ERM-3193 Error saving proxy
* ERM-3191 Add logging to support issue triage for HibernateOptimisticLockingFailureException
Expand Down
2 changes: 1 addition & 1 deletion service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ bootRun {
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx1024m')
'-Xmx1592m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
Expand Down
2 changes: 1 addition & 1 deletion service/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ gormVersion=8.0.3

# Application
appName=mod-agreements
appVersion=7.0.1
appVersion=7.0.2
dockerTagSuffix=
dockerRepo=folioci

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,13 @@ order by pj.dateCreated
}


@Transactional(propagation = MANDATORY)
//@Transactional(propagation = MANDATORY)
protected Collection<String> getViableRunners() {
appFederationService.allHealthyInstanceIds()
}

@Transactional(propagation = MANDATORY)
// Protected methods @Transactional gets ignored
//@Transactional(propagation = MANDATORY)
protected void cleanupAfterDeadRunners() {
Collection<String> viableRunnerIds = getViableRunners()

Expand Down Expand Up @@ -275,16 +276,16 @@ order by pj.dateCreated

WithPromises.task {
Tenants.withId(SystemDataService.DATASOURCE_SYSTEM) {
GormUtils.withTransaction {
log.debug("JobRunnerService::leaderTick")
cleanupAfterDeadRunners()
findAndRunNextJob()
log.debug("JobRunnerService::leaderTick:done")
}
}
GormUtils.withTransaction {
log.debug("JobRunnerService::leaderTick")
cleanupAfterDeadRunners()
findAndRunNextJob()
log.debug("JobRunnerService::leaderTick:done")
}
}
}
}

@Subscriber('federation:tick:drone')
void droneTick(final String instanceId) {

Expand All @@ -296,12 +297,12 @@ order by pj.dateCreated

WithPromises.task {
Tenants.withId(SystemDataService.DATASOURCE_SYSTEM) {
GormUtils.withTransaction {
log.debug("JobRunnerService::droneTick")
findAndRunNextJob()
log.debug("JobRunnerService::droneTick:done")
}
}
GormUtils.withTransaction {
log.debug("JobRunnerService::droneTick")
findAndRunNextJob()
log.debug("JobRunnerService::droneTick:done")
}
}
}
}

Expand Down Expand Up @@ -332,7 +333,8 @@ order by pj.dateCreated

}

@Transactional(propagation = MANDATORY)
// @Transactional on protected methods get ignored
//@Transactional(propagation = MANDATORY)
protected synchronized void findAndRunNextJob() {
log.debug("JobRunnerService::findAndRunNextJob")

Expand Down Expand Up @@ -457,7 +459,14 @@ order by pj.dateCreated
potentialJobs.remove( key )
} else {
allocateJob(tId, job.id)
if ( executeJob(type, tId, job.id, key) ) {
boolean added = false;
// Transaction needs to be explicitly wrapping this call now,
// since the @Transactional on that protected method is now ignored
GormUtils.withNewReadOnlyTransaction {
added = executeJob(type, tId, job.id, key)
}

if ( added ) {
totalSpace --
potentialJobs.remove( key )
}
Expand All @@ -479,7 +488,8 @@ order by pj.dateCreated
Tenants.withId(tId) { PersistentJob.read( jobId )?.getWork() }
} */

@Transactional(propagation=REQUIRES_NEW, readOnly=true)
// @Transactional ignored on private methods
//@Transactional(propagation=REQUIRES_NEW, readOnly=true)
private boolean executeJob ( final Type type, final String tId, final String jobId, final Instant key) {
boolean added = false

Expand Down

0 comments on commit 81a1610

Please sign in to comment.