Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

Commit

Permalink
chore(log): attach more info to exception logs
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKevJames committed Aug 9, 2018
1 parent ba6bfbd commit ce9eaa7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gcloud/rest/taskqueue/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def find_tasks_forever(self):
except BrokenTaskManagerException:
raise
except Exception as e: # pylint: disable=broad-except
log.exception(e)
log.error('swallowing exception in find_and_process_work()',
exc_info=e)
continue

if churning:
Expand All @@ -105,7 +106,8 @@ def find_and_process_work(self):
task_lease = self.tq.lease(num_tasks=self.batch_size,
lease_duration=self.lease_seconds)
except requests.exceptions.HTTPError as e:
log.exception(e)
log.error('got error attempting to lease tasks, retrying',
exc_info=e)
return True

if not task_lease:
Expand Down Expand Up @@ -142,7 +144,7 @@ def find_and_process_work(self):
lm.daemon = True
lm.start()
except Exception as e:
log.exception(e)
log.error('got error while scheduling task', exc_info=e)
raise BrokenTaskManagerException('broken process pool')

leasers.append((event, lm, data))
Expand Down

0 comments on commit ce9eaa7

Please sign in to comment.