12 Commits

Author SHA1 Message Date
Vivek Singh
9fd8a59b89 Update logs to reudce verbosity and consistency
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
2020-01-24 12:39:16 +00:00
Alex Ellis (OpenFaaS Ltd)
6a30ce1e36 Add transfer-encoding to watchdog env-vars if present
The Content-Type header must be ignored when the Transfer
Encoding is set to "chunked" because the length is unknown

Go sets this to -1 and we pass that onto the user:
https://golang.org/src/net/http/transfer.go

The value of Content_Length is currently set to -1 in this
scenario, however it caused some confusion for at least one
user in issue: #1422.

The Http_Transfer_Encoding value was tested by running the
watchdog on Linux with "env" as the fprocess and an extra
header to "curl"

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-01-06 21:41:05 +00:00
haozibi
e8b3818300 chore: add log for easy debug
Signed-off-by: haozibi <haozibi@foxmail.com>
2019-07-11 10:25:17 +01:00
Sargun Dhillon
b019f6ca54 Add Concurrency Limiter
This enables limiting concurrency. It is a naive approach which
will reject requests as soon as they exceed the maximum number
of in-flight requests.

It is a port of the following PR from the new watchdog code:
https://github.com/openfaas-incubator/of-watchdog/pull/54

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
2019-06-16 15:23:20 +01:00
Matias Pan
0384832299 Add unit tests for new env variable
Signed-off-by: Matias Pan <matias.pan26@gmail.com>
2019-04-04 21:28:17 +01:00
Matias Pan
9477970924 Add Http_Content_Length to env variables
Http_ContentLengh will be deprecated in the future.

Signed-off-by: Matias Pan <matias.pan26@gmail.com>
2019-04-04 21:28:17 +01:00
Mike Chiu
1261aadebe Fix fwatchdog timer memory leak issue
Use timer.AfterFunc to make sure goroutine could be gc.

Signed-off-by: Mike Chiu <mike.chiu@pentium.network>
2019-01-02 22:46:03 +00:00
Alex Ellis
7db8ad1bda Update README files
- Removes use of "our" from CONTRIBUTING guide
- Updates/adds README.md files
- Commnents and typo fix in watchdog
- Adds good/bad examples of commit messages

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-10-03 14:07:41 +01:00
Alex Ellis (VMware)
e67811c91c Alter graceful shutdown sequence
- the shutdown sequence meant that the kubelet was still passing
work to the watchdog after the HTTP socket was closed. This change
means that the kubelet has a chance to run its check before we
finally stop accepting new connections. It will require some
basic co-ordination between the kubelet's checking period and the
"write_timeout" value in the container.

Tested with Kubernetes on GKE - before the change some Pods were
giving a connection refused error due to them being not detected
as unhealthy. Now I receive 0% error rate even with 20 qps.

Issue was shown by scaling to 20 replicas, starting a test with
hey and then scaling to 1 replica while tailing the logs from the
gateway. Before I saw some 502, now I see just 200s.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-09-17 11:48:16 +01:00
Edward Wilde
e9f5be107b Adds support for additional PATCH HTTP verb
Full list of supported verbs is now supported: "GET", "POST", "PUT",
"PATCH", "DELETE"

Relates to: #openfaas/faas/issues/815

Signed-off-by: Edward Wilde <ewilde@gmail.com>
2018-08-22 20:10:03 +01:00
Alex Ellis (VMware)
a4c867fd8f Adds HTTP Host entry
Fixes: https://github.com/openfaas-incubator/of-watchdog/pull/24

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-08-13 17:42:49 +01:00
Alex Ellis (VMware)
08a080dcb2 Print version flag on every run
Moves handler code into separate file but retains same
package.

Changes watchdog to print version on start-up so that we can
grab this from logs. Version flag is also present for getting
additional information if needed from a user's published
container without running their function.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-04-14 17:48:28 -07:00