Added few more logs for upload_blob operation.
Change-Id: I3eb6485992ce686944bd94e5dc8c6a2e53f4a8b6
This commit is contained in:
parent
92bc2ad89f
commit
86d40aa3bf
@ -743,12 +743,17 @@ def delete_lock(context, lock_id, session):
|
|||||||
stop_max_attempt_number=50)
|
stop_max_attempt_number=50)
|
||||||
def save_blob_data(context, blob_data_id, data, session):
|
def save_blob_data(context, blob_data_id, data, session):
|
||||||
"""Save blob data to database."""
|
"""Save blob data to database."""
|
||||||
with session.begin():
|
LOG.debug("Starting Blob data upload in database for %s", blob_data_id)
|
||||||
blob_data = models.ArtifactBlobData()
|
try:
|
||||||
blob_data.id = blob_data_id
|
with session.begin():
|
||||||
blob_data.data = data.read()
|
blob_data = models.ArtifactBlobData()
|
||||||
blob_data.save(session=session)
|
blob_data.id = blob_data_id
|
||||||
return "sql://" + blob_data.id
|
blob_data.data = data.read()
|
||||||
|
blob_data.save(session=session)
|
||||||
|
return "sql://" + blob_data.id
|
||||||
|
except Exception as e:
|
||||||
|
LOG.error("Exception received during blob upload %s", e)
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
@retry(retry_on_exception=_retry_on_deadlock, wait_fixed=500,
|
@retry(retry_on_exception=_retry_on_deadlock, wait_fixed=500,
|
||||||
|
@ -602,8 +602,10 @@ class Engine(object):
|
|||||||
fd, path = tpool.execute(
|
fd, path = tpool.execute(
|
||||||
af.validate_upload, context, af, field_name, fd)
|
af.validate_upload, context, af, field_name, fd)
|
||||||
else:
|
else:
|
||||||
|
LOG.debug("Initiating Pre_upload hook")
|
||||||
fd = tpool.execute(af.pre_upload_hook,
|
fd = tpool.execute(af.pre_upload_hook,
|
||||||
context, af, field_name, blob_key, fd)
|
context, af, field_name, blob_key, fd)
|
||||||
|
LOG.debug("Pre_upload hook executed successfully")
|
||||||
except exception.GlareException:
|
except exception.GlareException:
|
||||||
raise
|
raise
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -634,10 +636,17 @@ class Engine(object):
|
|||||||
{'artifact': af.id, 'blob': blob_name})
|
{'artifact': af.id, 'blob': blob_name})
|
||||||
|
|
||||||
# Step 3. Change blob status to 'active'
|
# Step 3. Change blob status to 'active'
|
||||||
with self.lock_engine.acquire(context, lock_key):
|
try:
|
||||||
af = af.show(context, artifact_id)
|
with self.lock_engine.acquire(context, lock_key):
|
||||||
af = self._save_blob_info(
|
af = af.show(context, artifact_id)
|
||||||
context, af, field_name, blob_key, blob_info)
|
af = self._save_blob_info(
|
||||||
|
context, af, field_name, blob_key, blob_info)
|
||||||
|
except Exception as e:
|
||||||
|
msg = _("Exception occured while updating blob status to active"
|
||||||
|
" for artifact Id : [%(artifact_id)s] , %(error_msg)s") %\
|
||||||
|
{"artifact_id": artifact_id, "error_msg": str(e)}
|
||||||
|
LOG.error(msg)
|
||||||
|
raise
|
||||||
|
|
||||||
af.post_upload_hook(context, af, field_name, blob_key)
|
af.post_upload_hook(context, af, field_name, blob_key)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user