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

Dramatiq workers hangs very often, no logs were seen in logs even if it is verbose mode. #578

Open
7 tasks done
Harinib-Kore opened this issue Sep 13, 2023 · 4 comments
Open
7 tasks done

Comments

@Harinib-Kore
Copy link

Harinib-Kore commented Sep 13, 2023

Issues

GitHub issues are for bugs. If you have questions, please ask them on the mailing list.

Checklist

  • Does your title concisely summarize the problem?
  • Did you include a minimal, reproducible example?
  • What OS are you using?
  • What version of Dramatiq are you using?
  • What did you do?
  • What did you expect would happen?
  • What happened?

What OS are you using?

Centos

What version of Dramatiq are you using?

Dramatiq version 1.14.2

What did you do?

Processing parallel async requests using dramatiq

What did you expect would happen?

It should work properly it should receive messages and tasks, but it is getting hanged.

What happened?

We are processing parallel async requests. It will work fine for 3 days and again the same issue occurs. If we restart the workers then it works , how to fix this

dramatiq dramatiq_app.BatchOperationsDramatiqTasks --processes 1 --verbose

I cant see anything in logs files. Even logs getting hanged

error which i captured when logs got hanged

Exception in thread Thread-1: Traceback (most recent call last): File "/data/py3.9.7/lib/python3.9/[threading.py](https://threading.py/)", line 973, in _bootstrap_inner [self.run](https://self.run/)() File "/data/py3.9.7/lib/python3.9/[threading.py](https://threading.py/)", line 910, in run self._target(*self._args, **self._kwargs) File "/data/py3.9.7/Findly/lib/python3.9/site-packages/dramatiq/[cli.py](https://cli.py/)", line 328, in watch_logs data = event.recv_bytes() File "/data/py3.9.7/lib/python3.9/multiprocessing/[connection.py](https://connection.py/)", line 221, in recv_bytes buf = self._recv_bytes(maxlength) File "/data/py3.9.7/lib/python3.9/multiprocessing/[connection.py](https://connection.py/)", line 426, in _recv_bytes return self._recv(size) File "/data/py3.9.7/lib/python3.9/multiprocessing/[connection.py](https://connection.py/)", line 384, in _recv chunk = read(handle, remaining) MemoryError

@Harinib-Kore Harinib-Kore changed the title Dramatiq workers hangs after very often, no logs were seen in logs even if it is verbose mode. Dramatiq workers hangs very often, no logs were seen in logs even if it is verbose mode. Sep 13, 2023
@spumer
Copy link

spumer commented Sep 22, 2023

We got something similiar with --process 1 --threads 2. When Worker consume one queue and produce messages to another.
We reproduce it yesterday and will investigate what happend actually

Quick fix was --process 1 --threads 1
UPD: we produce messages to another queue trough kombu and kombu.Connection not thread-safe. In that case you got infinity wait on _read, cause bot threads call _read and read different parts of incoming data and both can't construct frame and infinity wait for next data.

@Alsheh
Copy link

Alsheh commented Oct 16, 2023

I've observed similar behavior when the CPU reaches 100%.

@menezes-
Copy link

menezes- commented Oct 27, 2023

I have the same issue with 1.15 (python 3.11) using the AsyncIO middleware.
using --process 1 --threads 1 works

@agamrp
Copy link

agamrp commented Nov 10, 2023

I am seeing this as well running with --processes 4 --threads 1 running through django_dramatiq
I'll try updating to 1 process and see how that goes. Also using dramatiq 1.5 (python 3.10)

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

5 participants