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

If label is not str worker fails without traceback #278

Open
AnikinNN opened this issue Jan 25, 2024 · 1 comment
Open

If label is not str worker fails without traceback #278

AnikinNN opened this issue Jan 25, 2024 · 1 comment

Comments

@AnikinNN
Copy link

If a label with a type different from str is added anywhere in the worker task, the task will fail.

@broker.task
async def generation_task(params: RequestParams, context: Annotated[Context, TaskiqDepends()]):
    result = do_some_work(params)
    context.message.labels['non_str_field'] = 42
    return result

I suspect the issue lies in the construction of the TaskiqResult object at /taskiq/receiver/receiver.py:294.

While it's acceptable for the task to fail on unknown types, the problem is that it doesn't display anything in the log. This lack of information made it necessary for me to spend extra time figuring out what went wrong.

Perhaps, to make this workaround clearer, we could consider adding some logging?

@s3rius
Copy link
Member

s3rius commented Jan 25, 2024

Totally agree on that one.

That's weird that receiver fails after non-string label. Also we have this PR waiting to be merged that might solve your issue as well.

#243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants