[Swift-devel] [Bug 257] New: Race condition in Swiftscript execution

bugzilla-daemon at mcs.anl.gov bugzilla-daemon at mcs.anl.gov
Wed Feb 16 13:54:16 CST 2011


https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=257

           Summary: Race condition in Swiftscript execution
           Product: Swift
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: General
        AssignedTo: hategan at mcs.anl.gov
        ReportedBy: tim.g.armstrong at gmail.com


Created an attachment (id=289)
 --> (http://bugzilla.mcs.anl.gov/swift/attachment.cgi?id=289)
Swift script and Swift logs for passing and failing cases.

I am running:
Swift svn swift-r4087 cog-r3051

I have come across a race condition in a script that I have been using for a
while. .  What it does is launches a dummy job (to ensure everything is started
up), then sits in a serial loop, acting as a server listening on a named pipe
for tasks to execute.

 Every 5 or so times the script runs, the dummy jobs completes but the script
it fails to even enter into the loop.  I have attached logs for both the usual
(correct) behaviour, and the race condition.  The side-by-side diff at the
bottom illustrates clearly where the behaviour diverges.

= rserver.swift ============================================================
type file;
type RData;


app (external e, RData result, file stout, file sterr) runR (file shellscript,
file RServerScript, RData rcall)
{
  bash @shellscript @RServerScript @rcall @result stdout=@stout stderr=@sterr;
}

app ack (external e[])
{
   bashlocal "-c" @strcat("echo done > ",resultPipeName);
}

app passivate ()
{
  bash "-c" "echo dummy swift job;";
}

(external e[]) apply (string runDir)
{
  RData rcalls[]  <simple_mapper; location=runDir, prefix="cbatch.",
suffix=".Rdata", padding=0>;
  RData results[] <simple_mapper; location=runDir, prefix="rbatch.",
suffix=".Rdata", padding=0>;
  file  stout[]   <simple_mapper; location=runDir, prefix="stdout.",
suffix=".txt", padding=0>;
  file  sterr[]   <simple_mapper; location=runDir, prefix="stderr.",
suffix=".txt", padding=0>;

  file  runRscript <"EvalRBatchPersistent.sh">;
  file  rsScript   <"SwiftRServer.R">;

  foreach c, i in rcalls {
    (e[i], results[i],stout[i], sterr[i]) = runR(runRscript,rsScript,c);
  }
}

passivate();

string pipedir = @arg("pipedir");
global string requestPipeName = @strcat(pipedir,"/requestpipe");
global string resultPipeName = @strcat(pipedir,"/resultpipe");

iterate serially {
  boolean done;
  string dir;

  dir = readData(requestPipeName); # Reads direct from this local pipe. Assumes
Swift started in right dir.

  external wait[];
  wait = apply(dir);

  if (dir=="done") { done=true; } else { done=false;}

  fprintf(resultPipeName, "%kdone\n", wait);

} until (done);


= sidebyside ============================================================
Loader Max heap: 238616576                     Loader Max heap: 238616576 
Loader rserver.swift: source file is new. Recompiling.         Loader
rserver.swift: source file is new. Recompiling. 
Karajan Validation of XML intermediate file was successful     Karajan
Validation of XML intermediate file was successful 
VDL2ExecutionContext Stack dump:                 VDL2ExecutionContext Stack
dump: 

iB = 0, bA = false, bB = false]                 iB = 0, bA = false, bB = false] 

configuration [cf]                         configuration [cf] 





unknown Using sites file: sites.xml                 unknown Using sites file:
sites.xml 
unknown Using tc.data: tc                     unknown Using tc.data: tc 
AbstractScheduler Setting resources to: {local3=local3, fork=   
AbstractScheduler Setting resources to: {local3=local3, fork=
unknown Swift svn swift-r4087 cog-r3051             unknown Swift svn
swift-r4087 cog-r3051 

unknown RUNID id=run:20110216-1244-7l6y6irf               |    unknown RUNID
id=run:20110216-1246-vfu3jq4c 
VDLFunction FUNCTION: arg()                     VDLFunction FUNCTION: arg() 
SetFieldValue Set: pipedir=/tmp/tga/SwiftR/swift.1237           |   
SetFieldValue Set: pipedir=/tmp/tga/SwiftR/swift.1447 
                                  >    SetFieldValue Set:
requestPipeName=/tmp/tga/SwiftR/swift.1447
                                  >    SetFieldValue Set:
resultPipeName=/tmp/tga/SwiftR/swift.1447/
vdl:execute START thread=0-0 tr=bash                 vdl:execute START
thread=0-0 tr=bash 
WeightedHostScoreScheduler CONTACT_SELECTED host=local0, scor <
apply STARTCOMPOUND thread=0-4-0-1 name=apply             apply STARTCOMPOUND
thread=0-4-0-1 name=apply 
                                  >    SetFieldValue Set: done=false 
                                  >    WeightedHostScoreScheduler
CONTACT_SELECTED host=local3, scor
GlobalSubmitQueue No global submit throttle set. Using defaul   
GlobalSubmitQueue No global submit throttle set. Using defaul
LateBindingScheduler JobQueue: 0                 LateBindingScheduler JobQueue:
0 
LateBindingScheduler JobQueue: 0                   |    AbstractDataNode Found
data org.griphyn.vdl.mapping.RootDataN
vdl:initshareddir START host=local0 - Initializing shared dir |   
AbstractDataNode Found data org.griphyn.vdl.mapping.RootDataN
AbstractDataNode Found data org.griphyn.vdl.mapping.RootDataN <
AbstractDataNode Found data org.griphyn.vdl.mapping.RootDataN <
SetFieldValue Set: swift#mapper#17003=cbatch.             SetFieldValue Set:
swift#mapper#17003=cbatch. 
SetFieldValue Set: swift#mapper#17005=.Rdata             SetFieldValue Set:
swift#mapper#17005=.Rdata 
SetFieldValue Set: swift#mapper#17007=0             SetFieldValue Set:
swift#mapper#17007=0 
SetFieldValue Set: swift#mapper#17008=rbatch.             SetFieldValue Set:
swift#mapper#17008=rbatch. 
SetFieldValue Set: swift#mapper#17010=.Rdata             SetFieldValue Set:
swift#mapper#17010=.Rdata 
SetFieldValue Set: swift#mapper#17011=0               <
SetFieldValue Set: swift#mapper#17012=stdout.             SetFieldValue Set:
swift#mapper#17012=stdout. 
SetFieldValue Set: swift#mapper#17014=.txt             SetFieldValue Set:
swift#mapper#17014=.txt 
SetFieldValue Set: swift#mapper#17016=0               |    SetFieldValue Set:
swift#mapper#17020=0 
                                  >    SetFieldValue Set: swift#mapper#17011=0 
SetFieldValue Set: swift#mapper#17017=stderr.             SetFieldValue Set:
swift#mapper#17017=stderr. 
SetFieldValue Set: swift#mapper#17019=.txt             SetFieldValue Set:
swift#mapper#17019=.txt 
SetFieldValue Set: swift#mapper#17020=0               |    SetFieldValue Set:
swift#mapper#17016=0 
                                  >    AbstractDataNode Found data
rcalls.$[]/1.[1] 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    vdl:initshareddir START host=local3 -
Initializing shared dir
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    vdl:execute START thread=0-4-0-1-12-0-1
tr=bash 
                                  >    WeightedHostScoreScheduler
CONTACT_SELECTED host=local1, scor
                                  >    vdl:initshareddir START host=local1 -
Initializing shared dir
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    LateBindingScheduler JobQueue: 0 
LateBindingScheduler JobQueue: 0                 LateBindingScheduler JobQueue:
0 
LateBindingScheduler JobQueue: 0                 LateBindingScheduler JobQueue:
0 
LateBindingScheduler JobQueue: 0                 LateBindingScheduler JobQueue:
0 
LateBindingScheduler JobQueue: 0                 LateBindingScheduler JobQueue:
0 
LateBindingScheduler JobQueue: 0                 LateBindingScheduler JobQueue:
0 
vdl:initshareddir END host=local0 - Done initializing shared  <
vdl:createdirset START jobid=bash-dls6916k host=local0 - Init <
vdl:createdirset END jobid=bash-dls6916k - Done initializing  <
vdl:dostagein START jobid=bash-dls6916k - Staging in files    <
vdl:dostagein END jobid=bash-dls6916k - Staging in finished   <
GridExec TASK_DEFINITION: Task(type=JOB_SUBMISSION, identity= <
JobSubmissionTaskHandler Submit: in: /tmp/tga/SwiftR/swift.12 <
LateBindingScheduler JobQueue: 0                 LateBindingScheduler JobQueue:
0 
vdl:dostageout START jobid=bash-dls6916k - Staging out files  |   
LateBindingScheduler JobQueue: 0 
vdl:dostageout END jobid=bash-dls6916k - Staging out finished |   
vdl:initshareddir END host=local1 - Done initializing shared 
                                  >    vdl:initshareddir END host=local3 - Done
initializing shared 
                                  >    vdl:createdirset START
jobid=bash-nq2a916k host=local3 - Init
                                  >    vdl:createdirset END jobid=bash-nq2a916k
- Done initializing 
                                  >    vdl:dostagein START jobid=bash-nq2a916k
- Staging in files 
                                  >    vdl:createdirset START
jobid=bash-mq2a916k host=local1 - Init
                                  >    vdl:dostagein END jobid=bash-nq2a916k -
Staging in finished 
                                  >    vdl:createdirs START
path=tmp/tga/SwiftR/requests.P31228/R000
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    vdl:createdirset END jobid=bash-mq2a916k
- Done initializing 
                                  >    vdl:dostagein START jobid=bash-mq2a916k
- Staging in files 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    GridExec TASK_DEFINITION:
Task(type=JOB_SUBMISSION, identity=
                                  >    JobSubmissionTaskHandler Submit: in:
/tmp/tga/SwiftR/swift.14
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    vdl:dostagein END jobid=bash-mq2a916k -
Staging in finished 
                                  >    GridExec TASK_DEFINITION:
Task(type=JOB_SUBMISSION, identity=
                                  >    JobSubmissionTaskHandler Submit: in:
/tmp/tga/SwiftR/swift.14
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    vdl:dostageout START jobid=bash-nq2a916k
- Staging out files 
                                  >    vdl:dostageout END jobid=bash-nq2a916k -
Staging out finished
LateBindingScheduler JobQueue: 0                 LateBindingScheduler JobQueue:
0 
vdl:execute END_SUCCESS thread=0-0 tr=bash             vdl:execute END_SUCCESS
thread=0-0 tr=bash 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    vdl:dostageout START jobid=bash-mq2a916k
- Staging out files 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    LateBindingScheduler JobQueue: 1 
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    vdl:dostageout END jobid=bash-mq2a916k -
Staging out finished
                                  >    LateBindingScheduler JobQueue: 0 
                                  >    vdl:execute END_SUCCESS
thread=0-4-0-1-12-0-1 tr=bash 
                                  >    apply ENDCOMPOUND thread=0-4-0-1 
                                  >    apply STARTCOMPOUND thread=0-4-1-1
name=apply 
                                  >    AbstractDataNode Found data
org.griphyn.vdl.mapping.RootDataN
                                  >    AbstractDataNode Found data
org.griphyn.vdl.mapping.RootDataN
                                  >    SetFieldValue Set:
swift#mapper#17003=cbatch. 
                                  >    SetFieldValue Set:
swift#mapper#17005=.Rdata 
                                  >    SetFieldValue Set: swift#mapper#17007=0 
                                  >    SetFieldValue Set:
swift#mapper#17008=rbatch. 
                                  >    SetFieldValue Set:
swift#mapper#17010=.Rdata 
                                  >    SetFieldValue Set: swift#mapper#17011=0 
                                  >    SetFieldValue Set:
swift#mapper#17012=stdout. 
                                  >    SetFieldValue Set:
swift#mapper#17014=.txt 
                                  >    SetFieldValue Set: swift#mapper#17016=0 
                                  >    SetFieldValue Set:
swift#mapper#17017=stderr. 
                                  >    SetFieldValue Set:
swift#mapper#17019=.txt 
                                  >    SetFieldValue Set: swift#mapper#17020=0

-- 
Configure bugmail: https://bugzilla.mcs.anl.gov/swift/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.



More information about the Swift-devel mailing list