def update_subtask_status(entry_id, current_task_id, new_subtask_status, retry_count=0):
 try:
  _update_subtask_status(entry_id, current_task_id, new_subtask_status)
 except DatabaseError:
  retry_count += 1
  if (retry_count < MAX_DATABASE_LOCK_RETRIES):
   TASK_LOG.info('Retrying to update status for subtask %s of instructor task %d with status %s:  retry %d', current_task_id, entry_id, new_subtask_status, retry_count)
   dog_stats_api.increment('instructor_task.subtask.retry_after_failed_update')
   update_subtask_status(entry_id, current_task_id, new_subtask_status, retry_count)
  else:
   TASK_LOG.info('Failed to update status after %d retries for subtask %s of instructor task %d with status %s', retry_count, current_task_id, entry_id, new_subtask_status)
   dog_stats_api.increment('instructor_task.subtask.failed_after_update_retries')
   raise
 finally:
  _release_subtask_lock(current_task_id)

def update_subtask_status ( entry_id , current_task_id , new_subtask_status , retry_count = 0 ) : try : _update_subtask_status ( entry_id , current_task_id , new_subtask_status ) except DatabaseError : retry_count += 1 if ( retry_count < MAX_DATABASE_LOCK_RETRIES ) : TASK_LOG . info ( 'Retrying to update status for subtask %s of instructor task %d with status %s:  retry %d' , current_task_id , entry_id , new_subtask_status , retry_count ) dog_stats_api . increment ( 'instructor_task.subtask.retry_after_failed_update' ) update_subtask_status ( entry_id , current_task_id , new_subtask_status , retry_count ) else : TASK_LOG . info ( 'Failed to update status after %d retries for subtask %s of instructor task %d with status %s' , retry_count , current_task_id , entry_id , new_subtask_status ) dog_stats_api . increment ( 'instructor_task.subtask.failed_after_update_retries' ) raise finally : _release_subtask_lock ( current_task_id )
update the status of the subtask in the parent instructortask object tracking its progress .