openfaas / of-watchdog

Reverse proxy for STDIO and HTTP microservices
MIT License
259 stars 115 forks source link

Allow Int values and parse as Seconds for Durations #90

Closed Waterdrips closed 4 years ago

Waterdrips commented 4 years ago

Description

The timeout values could be accidentally set as ints by a user rather than golang durations. This meant that "5" gets parsed to 0s not 5s. Now we try and parse non duration strings as seconds.

This has been tested by creating a function with the old binary, setting the timeouts for read, write and exec to "5" and 5. These are interpreted as 0s.

New binary swapped in and re-deployed, this then worked as our waits were less than the 5 seconds, when expanded over 5s (the waits) then the fn was stopped

Signed-off-by: Alistair Hey alistair@heyal.co.uk

Fixes #64

Motivation and Context

How Has This Been Tested?

This has been tested by creating a function with the old binary, setting the timeouts for read, write and exec to "5" and 5. These are interpreted as 0s.

New binary swapped in and re-deployed, this then worked as our waits were less than the 5 seconds, when expanded over 5s (the waits) then the fn was stopped

Types of changes

Checklist: