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

Is this dramatiq SQS broker thread safe? #23

Open
sparrowt opened this issue Dec 11, 2023 · 1 comment
Open

Is this dramatiq SQS broker thread safe? #23

sparrowt opened this issue Dec 11, 2023 · 1 comment

Comments

@sparrowt
Copy link

I noticed in https://github.com/Bogdanp/dramatiq/blob/master/docs/source/troubleshooting.rst it says:

Dramatiq operations on builtin brokers are thread-safe

however the broker in this repo is not built-in and I can't see any mention of thread safety nor any locking.

As far as I can see when a dramatiq task is enqueued then the following generic call chain occurs:
Actor.send > Actor.send_with_options > Broker.enqueue

Looking at SQSBroker.enqueue in this repo (which doesn't do any locking):

Given the above, is this broker potentially not thread safe, e.g. for simultaneously enqueuing from multiple threads of a web server process (such as gunicorn) to the same queue?

@Bogdanp
Copy link
Owner

Bogdanp commented Oct 8, 2024

Looking at your notes, I think you're probably right. I had missed that detail about boto resources. If anyone wants to fix this, I'd be happy to accept a PR.

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