Skip to content

Commit 092595d

Browse files
committed
identified issues
1 parent 5d848e1 commit 092595d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/service-library/src/servicelib/redis.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,12 @@ async def lock_context(
179179
raise CouldNotAcquireLockError(lock=ttl_lock)
180180

181181
async def _extend_lock(lock: Lock) -> None:
182-
with log_context(
183-
_logger, logging.DEBUG, f"Extending lock {lock_unique_id}"
184-
), log_catch(_logger, reraise=False):
182+
with (
183+
log_context(_logger, logging.DEBUG, f"Extending lock {lock_unique_id}"),
184+
log_catch(_logger, reraise=False),
185+
):
186+
# TODO: if we cannot re-acquire that means the lock is lost, and we are not anymore safe and should raise all the way to the caller
187+
185188
await lock.reacquire()
186189

187190
try:
@@ -213,6 +216,8 @@ async def _extend_lock(lock: Lock) -> None:
213216

214217
# Above implies that only one "task" `owns` and `extends` the lock at a time.
215218
# The issue appears to be related some timings (being too low).
219+
220+
# TODO: Why are we silencing this because of a TEST?????
216221
try:
217222
await ttl_lock.release()
218223
except redis.exceptions.LockNotOwnedError:

packages/service-library/src/servicelib/redis_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ async def _exclusive_task_starter(
8585
_logger.debug(
8686
"Could not acquire lock '%s' with value '%s'", lock_key, lock_value
8787
)
88+
# TODO: why is this silenced?
8889
except Exception as e:
8990
_logger.exception(e) # noqa: TRY401
9091
raise

0 commit comments

Comments
 (0)