Ludo
Ludo

Reputation: 2829

Broken Pipe in Django dev server - What does this actually mean?

I can't quite figure out a pattern to why/when I see it. Cheers.

Upvotes: 3

Views: 1347

Answers (2)

Leopd
Leopd

Reputation: 42777

By "pipe" it means the TCP connection between the server and the browser. By "broken" it means closed.

You'll see broken pipes when somebody closes their browser window, hits stop, or sometimes just from timing out because something else breaks the connection.

The confusing thing is that the python process likely won't notice that the connection is closed until it tries to write to it, which could be well after the connection closes.

Upvotes: 4

Issac Kelly
Issac Kelly

Reputation: 6359

I get this error when a browser closes a connection (it can time out, or can be manually closed). Normally it happens when I send too many connections to runserver at once (i.e. I'm serving static media, and loading a heavy page for the first time).

Django's runserver should not be used in production, and it doesn't handle concurrent connections with any grace. If this happens a lot, you can consider using something like django_cpserver or gunicorn in development, but you don't get as much debug information out of them in the console.

Upvotes: 2

Related Questions