caddy/caddyhttp
Angel Santiago 59bf71c293 proxy: Cleanly shutdown health checks on restart (#1524)
* Add a shutdown function and context to staticUpstream so that running goroutines can be cancelled. Add a GetShutdownFunc to Upstream interface to expose the shutdown function to the caddy Controller for performing it on restarts.

* Make fakeUpstream implement new Upstream methods.

Implement new Upstream method for fakeWSUpstream as well.

* Rename GetShutdownFunc to Stop(). Add a waitgroup to the staticUpstream for controlling individual object's goroutines. Add the Stop function to OnRestart and OnShutdown. Add tests for checking to see if healthchecks continue hitting a backend server after stop has been called.

* Go back to using a stop channel since the context adds no additional benefit.
Only register stop function for onShutdown since it's called as part of restart.

* Remove assignment to atomic value

* Incrementing WaitGroup outside of goroutine to avoid race condition. Loading atomic values in test.

* Linting: change counter to just use the default zero value instead of setting it

* Clarify Stop method comments, add comments to stop channel and waitgroup and remove out of date comment about handling stopping the proxy. Stop the ticker when the stop signal is sent
2017-04-02 14:58:15 -06:00
..
basicauth Added Const for use of CtxKeys (#1511) 2017-03-13 09:22:46 -06:00
bind Refactor how caddy.Context is stored and used 2016-06-20 11:59:23 -06:00
browse Add new browse sort - namedirfirst (#1551) 2017-04-02 20:38:14 +01:00
errors Roll all logs by default (#1379) 2017-02-08 09:23:33 -07:00
expvar Refactor how caddy.Context is stored and used 2016-06-20 11:59:23 -06:00
extensions Fix misspellings 2016-09-05 10:20:34 -06:00
fastcgi Added Const for use of CtxKeys (#1511) 2017-03-13 09:22:46 -06:00
gzip staticfiles: add Content-Length header (closes #1479) (#1492) 2017-03-12 16:41:49 -06:00
header HTTP/2 push support (golang 1.8) (#1215) 2017-02-17 09:25:22 -07:00
httpserver Don't modify request URL values from Caddyfile (fixes #1528) 2017-03-20 21:05:11 -06:00
internalsrv Feature #1246 - Remote syslog (#1301) 2017-02-08 08:02:09 -07:00
log Roll all logs by default (#1379) 2017-02-08 09:23:33 -07:00
markdown markdown: backup title should use TrimSuffix, not TrimRight (#1515) 2017-03-13 15:24:03 -06:00
maxrequestbody Add maxrequestbody directive (#1163) 2016-11-04 08:25:49 +08:00
mime Refactor how caddy.Context is stored and used 2016-06-20 11:59:23 -06:00
pprof pprof: Set proper Content-Type header 2017-01-24 16:55:43 -07:00
proxy proxy: Cleanly shutdown health checks on restart (#1524) 2017-04-02 14:58:15 -06:00
push Push down headers from client (#1453) 2017-02-18 15:50:36 -07:00
redirect Merge pull request #1365 from tw4452852/1297 2017-02-15 17:59:29 -07:00
rewrite Added Const for use of CtxKeys (#1511) 2017-03-13 09:22:46 -06:00
root fixing panic when root is symlink (#1429) 2017-02-15 22:02:51 -07:00
staticfiles browse: Use helper functions in staticfiles to redirect (#1497) 2017-03-15 10:17:12 -06:00
status Add 'status' middleware instead of 'status' directive for 'rewrite' middleware 2016-08-29 17:17:23 +03:00
templates templates: Set right response Content-Type 2017-03-07 11:11:52 +08:00
timeouts New 'timeouts' directive to configure timeouts; default timeouts enabled (#1368) 2017-01-24 08:15:25 -07:00
websocket Fix misspellings 2016-09-05 10:20:34 -06:00
caddyhttp_test.go HTTP/2 push support (golang 1.8) (#1215) 2017-02-17 09:25:22 -07:00
caddyhttp.go HTTP/2 push support (golang 1.8) (#1215) 2017-02-17 09:25:22 -07:00