Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Health check endpoint checks eth_syncing rather than highestBlock? #9004

Closed
stephgosling opened this issue Jun 28, 2018 · 3 comments
Closed
Labels
M6-rpcapi 📣 RPC API. Z1-question 🙋‍♀️ Issue is a question. Closer should answer. Z3-stale 🍃 Issue is in principle valid, but it is not relevant anymore or can not reproduced.
Milestone

Comments

@stephgosling
Copy link

I'm running:

  • Which Parity version?: Parity/v1.11.3-beta-a66e36b-20180605/x86_64-linux-gnu/rustc1.26.1
  • Which operating system?: Ubuntu 16.04
  • How installed?: official .deb from github
  • Are you fully synchronized?:yes
  • Which network are you connected to?: mainnet
  • Did you try to restart the node?: n/a

Other information

  • Environment: AWS
  • Instance type: t2.medium
  • Instance storage: gp2, 512GB (so 1536 IOPS + burst)

Background: we're evaluating running Parity services behind a loadbalancer for web and mobile clients, some of those clients will be connected via WebSocket. As such we need an health check that looks for parity availability but also state (broadly, up-to-dateness). In the above environment I'm curious as Parity sometimes disagrees with itself with regards to this.

Below are 3 curl commands run sequentially but in the same shell session: a call to the health endpoint, JSONRPC call asking for highestBlock, and the healthcheck endpoint again. I don't have timings between each but I'd expect it to be tens of milliseconds between them if not less.

(wrapped for readability):

root@ip-172-16-17-185:/var/log/nginx# curl -s localhost:8545/api/health | jq .; \
  curl -s -H "Content-Type: application/json" -X POST 
    --data '[{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1},
        {"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}]' localhost:8545 | jq; \
  curl -s localhost:8545/api/health | jq .
{
  "Ok": {
    "peers": {
      "status": "ok",
      "message": "",
      "details": [
        34,
        100
      ]
    },
    "sync": {
      "status": "needsAttention",
      "message": "Your node is still syncing, the values you see might be outdated. Wait until it's fully synced.",
      "details": true
    },
    "time": {
      "status": "ok",
      "message": "",
      "details": 137
    }
  }
}
[
  {
    "jsonrpc": "2.0",
    "result": "0x59091b",
    "id": 1
  },
  {
    "jsonrpc": "2.0",
    "result": {
      "currentBlock": "0x59091b",
      "highestBlock": "0x59091b",
      "startingBlock": "0x58d6e0",
      "warpChunksAmount": null,
      "warpChunksProcessed": null
    },
    "id": 1
  }
]
{
  "Ok": {
    "peers": {
      "status": "ok",
      "message": "",
      "details": [
        34,
        100
      ]
    },
    "sync": {
      "status": "needsAttention",
      "message": "Your node is still syncing, the values you see might be outdated. Wait until it's fully synced.",
      "details": true
    },
    "time": {
      "status": "ok",
      "message": "",
      "details": 137
    }
  }
}

the healthcheck is returning unhealthy before-and-after, (with HTTP response 412, so would drop out of the balancer) yet currentBlock == highestBlock

@5chdn 5chdn added this to the 1.12 milestone Jun 28, 2018
@5chdn 5chdn added Z1-question 🙋‍♀️ Issue is a question. Closer should answer. M6-rpcapi 📣 RPC API. labels Jun 28, 2018
@Tbaut
Copy link
Contributor

Tbaut commented Jun 29, 2018

Could not reproduce on Kovan.. needs investigation and check in the code.

@5chdn 5chdn modified the milestones: 2.0, 2.1 Jul 17, 2018
@seanturner83
Copy link

I use this for now... https://github.com/seanturner83/eth-height-health

@5chdn 5chdn modified the milestones: 2.1, 2.2 Sep 11, 2018
@5chdn 5chdn modified the milestones: 2.2, 2.3 Oct 29, 2018
@jam10o-new jam10o-new added the Z3-stale 🍃 Issue is in principle valid, but it is not relevant anymore or can not reproduced. label Nov 9, 2018
@jam10o-new
Copy link
Contributor

/api/health was removed completely so this issue is no longer really relevant; more recently #9847 was added to do what it used to do, but with behaviour closer to what you expected as per this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
M6-rpcapi 📣 RPC API. Z1-question 🙋‍♀️ Issue is a question. Closer should answer. Z3-stale 🍃 Issue is in principle valid, but it is not relevant anymore or can not reproduced.
Projects
None yet
Development

No branches or pull requests

5 participants