openfaas / of-watchdog

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

Fix: replace custom timer logic with standard context deadlines #139

Closed cmacq2 closed 2 years ago

cmacq2 commented 2 years ago

Description

Gets rid of segfaults and leaked child processes when running in streaming mode.

Previously the OpenFAAS watchdog implemented custom logic based on a timer to kill function processes that exceed some exec_timeout. This solution was susceptible to panics and resource leaks:

With this change the entire timer based solution is discarded in favour of standard CommandContext API from the exec package.

Fixes: #138

Motivation and Context

See: #138

How Has This Been Tested?

Types of changes

Checklist: