Skip to content

Consul health check breaks webservice-deviceserver? #20

Open
@mkowalczyk88

Description

@mkowalczyk88

Maybe I missed something obvious in configuration but the Device Server doesn't work for me. I use Ubuntu 16.04 and configured everything as described in Readme file of this project (running docker-composer). I've then tried to run tests from https://github.com/CreatorDev/creator-js-client and both have failed.

Here's my investigation:
Firstly, the assumption: Fabio can only route to services that are "passing" Consul's health check.
Now, accessing Webservice sometimes results with error 404 and sometimes with error 502. If the status of webservice-deviceserver in consul is "not passing" then Fabio reports "no route to host" and I'm getting 404. When the route is found (webserivce-deviceserver passes health check) I'm getting error 502 and Fabio reports http request error "EOF". Note, if the Consul's health check fails then Fabio's route to it is simply removed.
Consul checks webservice-deviceserver every 2 seconds by issuing GET request to "/". When sniffing with Wireshark I could observe that some requests are accepted by webservice and then proper JSON with "links" is returned, but sometimes the connection itself is refused (webservice responds with tcp RST packet). In that case, the "EOF" (which is not EOF but simply connection refused error) is seen in logs of Consul and Fabio.
When issuing POST request from creator-js-client tests similar problem is observed. If the route in Fabio is present then connection to webservice is closed just after establishing it (FIN packet just after ACK-SYN-ACK packets is sent). If the route is not present at all I'm getting error 404.
I did a little hack to verify the behavior. I've modified Registrar env variables in docker-composer.yml that way so it doesn't use request to "/" as a health check but instead a dummy script that always succeeds. When webservice is not spammed with health check requests suddenly the creator-js-client tests are passing. However, the first try of tests still fails (FIN packet sent from webservice just after connection) all other requests are handled properly.
I have no idea how the ASP Net works internally, so please have a look/comment. From my observation the conclusion is that the webservice-deviceserver refuses TCP connections some times, especially when it is spammed with Consul health checks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions