jhuckaby / Cronicle

A simple, distributed task scheduler and runner with a web based UI.
http://cronicle.net
Other
3.85k stars 386 forks source link

Unable to call POST methods against the API in multi-server Cronicle cluster #711

Open dsturgilljr opened 9 months ago

dsturgilljr commented 9 months ago

I believe this issue is well known, but the documentation is a bit misleading. Yes, most HTTP request libraries have an option to automatically follow redirects BUT only for GET and HEAD methods.

For API calls like update_event and create_event, this is an issue when having the primary eligible servers behind a load balancer. Is the expectation to disable automatic redirects and handle the 302s manually or is there a better way?

jhuckaby commented 9 months ago

I did not know most HTTP request libraries only supported redirects on GET/HEAD. That is rather unfortunate.

For Cronicle v2, I have a feature where load balancers can hit a special URI for a health check, and only the current master returns a HTTP 200. All other servers return a HTTP 503. So this way you can have your load balancer group only contain the current master, automatically. This should eliminate the need for a redirect.

V2 is due out later this year (2024).