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

Fixed output of logs (tail/maintail) in the Web UI #195

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions supervisor/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ def handle_request(self, request):
# the lack of a Content-Length header makes the outputter
# send a 'Transfer-Encoding: chunked' response

request.push(tail_f_producer(request, logfile, 1024))
request.push(tail_f_producer(request, logfile, 1024).more())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code pushed the tail_f_producer instance onto the request. This was intentional because the code is asynchronous. Once the producer instance is pushed, the event loop will call more() on it each time it comes around. This is how we are able to stream log output continuously when you use supervisorctl tail -f.

This patch changed the code to push the result of tail_f_producer(x).more() instead of the producer instance. The result of more() will be a string with some log output. This is why the patch may have appeared to fix the output on the web interface. However, this doesn't set up the producer in the event loop like we originally intended, and it can never stream this way (the -f in tail -f).


request.done()

Expand Down Expand Up @@ -764,7 +764,7 @@ def handle_request(self, request):
# the lack of a Content-Length header makes the outputter
# send a 'Transfer-Encoding: chunked' response

request.push(tail_f_producer(request, logfile, 1024))
request.push(tail_f_producer(request, logfile, 1024).more())

request.done()

Expand Down