Closed 0x416e746f6e closed 1 year ago
Interesting! This PR does a lot and I don't have the resources to review the nuances of these changes right now. Will defer to @dvush and @Ruteri
oh, there's also https://github.com/flashbots/rpc-endpoint/pull/114 that somewhat overlaps. sorry @dvush, I didn't see it before. please let me know if I should refactor this PR to build on top of yours.
@0x416e746f6e , yes adapt please. It already handles graceful shutdown except health endpoint part
yes adapt please. It already handles graceful shutdown except health endpoint part
@dvush: updated! please have a look.
This PR implements separate HTTP server listening on
DRAIN_ADDR
. When it receives HTTP GET, it will flag server as un-healthy. From that moment on/health
endpoint of the main HTTP server will start reportingHTTP 500
.If we use this in conjunction with k8s pre-stop hook, we can make sure that on updates/restarts the pod lives long enough to serve whatever requests the load-balancer would still forward to it until it detects that the server is not healthy.
For example: