Bug 1551 - Race condition in job manager
: Race condition in job manager
Status: RESOLVED FIXED
: GRAM
gt2 Gatekeeper/Jobmanager
: 1.6
: PC All
: P2 major
: 4.2.1
Assigned To:
:
: VDT
:
: 6192
  Show dependency treegraph
 
Reported: 2004-02-13 14:32 by
Modified: 2008-08-15 04:44 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-02-13 14:32:05
Here is a patch for another race condition in the job manager. It is from 
David Smith at CERN, and has been tested as part of the VDT. 

-alain
------- Comment #1 From 2004-02-13 14:43:24 -------
Bugzilla is driving me crazy. It won't let me attach a file, so I will just 
copy and paste it instead. 

--- bad/gram/jobmanager/source/globus_gram_job_manager_state.c  Mon Feb  2 
16:32:13 2004
+++ fix/gram/jobmanager/source/globus_gram_job_manager_state.c  Mon Feb  2 
16:42:44 2004
@@ -1803,10 +1803,10 @@
 
        event_registered = GLOBUS_TRUE;
    }
-   else if(request->two_phase_commit == 0)
-   {
-       /* Nothing to do here if we are not doing the two-phase
-        * commit protocol
+        else if(request->two_phase_commit == 0 || !request->client_contacts)
+        {
+            /* Nothing to do here if we are not doing the two-phase
+             * commit protocol or if we have no client callbacks
         */
             if(request->jobmanager_state ==
            GLOBUS_GRAM_JOB_MANAGER_STATE_TWO_PHASE_END)
@@ -2148,11 +2148,6 @@
        break;
    }
 
-   /*
-    * To do a two-phase commit, we need to send an error
-    * message (WAITING_FOR_COMMIT) in the initial reply; otherwise,
-    * we just return the current status code.
-         */
    if(request->unsent_status_change)
    {
             if(request->job_history_status != request->status)
@@ -2165,7 +2160,13 @@
        request->unsent_status_change = GLOBUS_FALSE;
    }
 
-   if(request->two_phase_commit != 0)
+   /*
+    * If there are no client callbacks then skip the two phase end
+         * commit delay, since there is nobody listening to the state
+         * changes to send the commit.
+         */
+
+   if(request->two_phase_commit != 0 && request->client_contacts)
    {
        GlobusTimeReltimeSet(delay_time, request->two_phase_commit, 0);

------- Comment #2 From 2004-03-08 10:19:32 -------
Won't this (like the bug 1550 patch) cause the two-phase end to not work 
correctly when no clients are registered for notifications? If there is no 
client listening for notification, wouldn't you want the job manager to save  
state and exit instead of going to the committed state? 
 
joe 
------- Comment #3 From 2006-10-02 13:26:44 -------
This bug is two years old with no response. If it's still an issue, feel free
to reopen it.
------- Comment #4 From 2008-08-15 04:44:12 -------
The patches for these are committed to 4.2 branch and trunk.