usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [07/10] git commit: Implements USERGRID-205
Date Wed, 30 Jul 2014 22:00:23 GMT
Implements USERGRID-205

Fixes ordering issue with signaling death before saving job status


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/e9ccc222
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/e9ccc222
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/e9ccc222

Branch: refs/heads/master
Commit: e9ccc22273a1492751dfae60a67f559c9fc7352a
Parents: 530d0e9
Author: Todd Nine <toddnine@apache.org>
Authored: Tue Jul 29 18:06:58 2014 -0600
Committer: Todd Nine <toddnine@apache.org>
Committed: Tue Jul 29 18:06:58 2014 -0600

----------------------------------------------------------------------
 .../apache/usergrid/batch/service/JobSchedulerService.java    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e9ccc222/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java
b/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java
index 56d5704..2ec0be0 100644
--- a/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java
+++ b/stack/core/src/main/java/org/apache/usergrid/batch/service/JobSchedulerService.java
@@ -191,13 +191,13 @@ public class JobSchedulerService extends AbstractScheduledService {
 
                 execution.start( maxFailCount );
 
-                jobAccessor.save( execution );
 
                 //this job is dead, treat it as such
                 if ( execution.getStatus() == Status.DEAD ) {
 
                     try {
                         job.dead( execution );
+                        jobAccessor.save( execution );
                     }
                     catch ( Exception t ) {
                         //we purposefully swallow all exceptions here, we don't want it to
effect the outcome
@@ -208,8 +208,13 @@ public class JobSchedulerService extends AbstractScheduledService {
                     return null;
                 }
 
+                jobAccessor.save( execution );
+
                 // TODO wrap and throw specifically typed exception for onFailure,
                 // needs jobId
+
+                LOG.info( "Starting job {} with execution data {}", job, execution );
+
                 job.execute( execution );
 
                 if ( currentListener != null ) {


Mime
View raw message