Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

improved handling of state update synchronization

@Pradeep can you retry with 0.4.117? Thanks
  • Loading branch information...
commit 820b5b38082056c71cea888bc4bc61a18a557c61 1 parent 75c8afe
@drelu drelu authored
View
2  VERSION
@@ -1 +1 @@
-0.4.116
+0.4.117
View
2  bigjob/job_plugin/ec2ssh.py
@@ -122,7 +122,7 @@ def __init__(self, job_description, resource_url, pilot_compute_description):
aws_region = None
if self.pilot_compute_description.has_key("region"):
region = self.pilot_compute_description["region"]
- logger.debug("Connect to region: %s" + region)
+ logger.debug("Connect to region: %s"%(str(region)))
aws_region = boto.ec2.get_region(region,
aws_access_key_id=self.pilot_compute_description["access_key_id"],
aws_secret_access_key=self.pilot_compute_description["secret_access_key"]
View
10 examples/pilot-api/example-pilot-compute-data-cloud.py
@@ -25,9 +25,9 @@
pilot_data_description_aws={
"service_url": "s3://pilot-data-" + str(uuid.uuid1()),
"size": 100,
- "region" : "us-west-1", # or "" for DEFAULT/EAST
- "access_key_id":"",
- "secret_access_key":""
+ #"region" : "", # or "" for DEFAULT/EAST
+ "access_key_id":"AKIAJPGNDJRYIG5LIEUA",
+ "secret_access_key":"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"
}
pilot_data_description_india = {
@@ -74,8 +74,8 @@
"vm_ssh_keyfile":"/Users/luckow/.ssh/id_rsa",
"vm_type":"t1.micro",
"region" : "us-west-1",
- "access_key_id":"",
- "secret_access_key":""
+ "access_key_id":"AKIAJPGNDJRYIG5LIEUA",
+ "secret_access_key":"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"
}
View
16 pilot/impl/pilotdata_manager.py
@@ -501,7 +501,7 @@ def cancel(self):
def add_files(self, file_url_list=[]):
"""Add files referenced in list to Data Unit"""
- self.state=State.Pending
+ self._update_state(State.Pending)
item_list = DataUnitItem.create_data_unit_from_urls(None, file_url_list)
for i in item_list:
self.data_unit_items.append(i)
@@ -510,6 +510,7 @@ def add_files(self, file_url_list=[]):
for i in self.pilot_data:
logger.debug("Update Pilot Data %s"%(i.get_url()))
i.put_du(self)
+ self._update_state(State.Running)
CoordinationAdaptor.update_du(self)
@@ -560,9 +561,12 @@ def wait(self):
for i in self.transfer_threads:
i.join()
- # Wait for state to change
- while self.state!=State.Running and self.get_state()!=State.Failed:
- logger.debug("Waiting DU State: %s"%self.state)
+ # Wait for state to change
+ while True:
+ self.state = self.get_state()
+ if self.state==State.Running or self.state==State.Failed:
+ break
+ logger.debug("Waiting DU %s State: %s"%(self.get_url(), self.state))
time.sleep(2)
@@ -585,7 +589,7 @@ def export(self, target_url):
""" simple implementation of export:
copies file from first pilot data to local machine
"""
- if self.state!=State.Running:
+ if self.get_state()!=State.Running:
self.wait()
if len(self.pilot_data) > 0:
self.pilot_data[0].export_du(self, target_url)
@@ -623,7 +627,7 @@ def __add_pilot_data(self, pilot_data):
else: # copy files from original location
pilot_data.put_du(self)
self.pilot_data.append(pilot_data)
- self.state = State.Running
+ self._update_state(State.Running)
#self.url = CoordinationAdaptor.add_du(pilot_data.url, self)
CoordinationAdaptor.update_du(self)
Please sign in to comment.
Something went wrong with that request. Please try again.