seleniumkit / selenograph

Powered version of Selenium Grid Router
Other
42 stars 14 forks source link

Enhancement: safe shutdown #12

Open Shnitzelil opened 8 years ago

Shnitzelil commented 8 years ago

My current architecture is Two Selenograph services behind hardware load balacner (checking the /ping API status code)

When I wish to restart one of the machines I would like to stop it gently... my suggestion is to change the return status code from the /ping API to be 5xx or 4xx Or to change the return value from ok to something else (like "shunting down" or whatever). Once no new connection will arrive it will be fully shutdown.

Or any suggestion you have...

WDYT?

vania-pooh commented 8 years ago

Seems to be a good idea. I think current implementation is here: https://github.com/seleniumkit/gridrouter/blob/master/proxy/src/main/java/ru/qatools/gridrouter/PingServlet.java because in fact Selenograph wraps GridRouter code and adds more features.

Shnitzelil commented 8 years ago

@vania-pooh can the grid-router can work behind load-balancer like selenograph?

vania-pooh commented 8 years ago

@Shnitzelil sure. The main difference is the absence of MongoDB, extended stats and UI. The main advantage - it's stateless.

Shnitzelil commented 8 years ago

Should this be a different API not braking the Gridrouter API... Or, should we push this enhancement to Gridrouter and selenograph will consume this once this change will be publish?

vania-pooh commented 8 years ago

Summon @smecsia.

smecsia commented 8 years ago

@Shnitzelil Yes, we need to change the Gridrouter code to affect Selenograph this way. Send a PR to Gridrouter repository and we'll rebuild Selenograph with the newer features. I could also advice you to consider another solution. You can use nginx behind the selenograph nodes and configure it like this. This approach would allow you to reach the same result without Gridrouter code modification.