Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def handle_race(path):
show_runaway_processes(path)
if handle_race.limit > 0:
handle_race.limit -= 1
else:
reraise(Impossible('lock is held, but not by any process, ten times'))
handle_race.limit = 10
def on_lock_held(path):
reraise(LockHeld(
'another pgctl command is currently managing this service: (%s)\n%s' %
(bestrelpath(path), ps(fuser(path)))
))