Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.23.1 #210

Merged
merged 5 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.23.0
current_version = 1.23.1
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)([-](?P<release>(pre|rc))(?P<build>\d+))?
Expand Down
2 changes: 1 addition & 1 deletion servicelayer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

__version__ = "1.23.0"
__version__ = "1.23.1"

logging.getLogger("boto3").setLevel(logging.WARNING)
logging.getLogger("botocore").setLevel(logging.WARNING)
7 changes: 4 additions & 3 deletions servicelayer/taskqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ def increment_retry_count(self, conn):
conn.incr(self.retry_key)
conn.expire(self.retry_key, settings.REDIS_EXPIRE)

def clear_retry_count(self, conn):
conn.delete(self.retry_key)

def get_dataset(self, conn):
dataset = Dataset(
conn=conn, name=dataset_from_collection_id(self.collection_id)
Expand Down Expand Up @@ -317,9 +320,6 @@ def mark_for_retry(self, task):
pipe.srem(make_key(PREFIX, "qds", self.name, stage, "running"), task_id)
pipe.srem(make_key(PREFIX, "qds", self.name, stage), task_id)

# delete the retry key for the task
pipe.delete(task.retry_key)

pipe.set(self.last_update_key, pack_now())

pipe.execute()
Expand Down Expand Up @@ -595,6 +595,7 @@ def handle(self, task: Task, channel) -> Tuple[bool, bool]:
log.exception(
f"Task {task.task_id} permanently failed and will be discarded."
)
task.clear_retry_count(self.conn)
success = False
retry = False
except Exception:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="servicelayer",
version="1.23.0",
version="1.23.1",
description="Basic remote service functions for alephdata components",
classifiers=[
"Development Status :: 3 - Alpha",
Expand Down
5 changes: 3 additions & 2 deletions tests/test_taskqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ def test_task_queue(self):
delivery_tag=1, multiple=False, requeue=False
)
assert "Max retries reached for task test-task. Aborting." in ctx.output[0]
# Assert that retry count stays the same
assert task.get_retry_count(conn) == 1
# Assert that the retry count is 0 and the key is gone
assert task.get_retry_count(conn) == 0
assert conn.get("tq:qdj:2:taskretry:test-task") is None

worker.ack_message(worker.test_task, channel)
status = dataset.get_status()
Expand Down
Loading