Skip to content

Healthcheck is closing the connection abrutbly after reading status line  #171

@JonathanHuot

Description

@JonathanHuot

Current behavior:
upstream_check_module send healthcheck and kills the connection to the server once the module has read the HTTP status line (HTTP/1.1 200). However it leads to abnormal errors on server-side, because the server is still sending bytes into the HTTP connection while the connection get closed. It happens mostly when check responses contain a lot of HTTP headers, or has a huge body.

Proposed changes:
The attached PR, in addition to read the status line, reads also the HTTP header (every bytes until \r\n\r\n) before closing the connection. The immediate impact is that server-side does not longer raises errors, except for huge body; but we assume that checks are setup to return small payloads.

Step to reproduce issue:

configure nginx upstream to :8080 and send http checks to /ping every 3secs
run bottle as a server (as python code below)
wait few checks attempts until bottle display python exceptions

from bottle import route, run, template

@route('/ping')
def index():
return ""
run(host='localhost', port=8080)

Fixed in #170

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions