fanout / django-eventstream

Server-Sent Events for Django
MIT License
650 stars 85 forks source link

postgresql backend support #35

Open TheReal1604 opened 5 years ago

TheReal1604 commented 5 years ago

Hello django-evenstream devs,

in my setup there seems to be an issue with django-eventstream and postgresql support.

If I use sqlite as my main database backend, the events there pushed fine. I now migrated my app to a production system and changed my DB backend to postgres. The events there only pushed on shutdown of the daphne instance - really strange.

So to reproduce:

  1. Deploy Django App with postgres backend and daphne as our asgi webserver
  2. Try to send some event to your users
    • The user doesnt receive the updates, but it seems that the messages are some kind of queued.
  3. Stop the daphne worker - immediatly the user receives the update from the queue.

Just to repeat: with sqlite all is working as expected.

Any hint how to resolve that?

jkarneges commented 5 years ago

Hmm, I suspect a transaction blocking problem. Can you reproduce this with the chat example?