Skip to content

Commit

Permalink
fix(jenkins): Fixing missed build events on concurrent builds (#163)
Browse files Browse the repository at this point in the history
- Removed the use of parallelStream while processing builds
- parallelStream may lead to a concurrency issue with redis read/write for close enough builds
  • Loading branch information
jeyrschabu committed May 10, 2017
1 parent 6a1ad53 commit c0a15fa
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class JenkinsBuildMonitor implements PollingMonitor {
{ log.error("Error: ${it.message}") }
)

builds.parallelStream().forEach(
builds.stream().forEach(
{ Project project ->
try {
boolean addToCache = false
Expand Down Expand Up @@ -198,6 +198,7 @@ class JenkinsBuildMonitor implements PollingMonitor {
Project oldProject = new Project(name: project.name, lastBuild: build)
if (build.number != lastBuild
|| (build.number == lastBuild && cachedBuild.lastBuildBuilding != build.building)) {
log.info "sending event for intermediate build ${build.number}"
postEvent(echoService, cachedBuilds, oldProject, master)
}
} catch (e) {
Expand Down

0 comments on commit c0a15fa

Please sign in to comment.