openfaas / nats-queue-worker

Queue-worker for OpenFaaS with NATS Streaming
https://docs.openfaas.com/reference/async/
MIT License
129 stars 59 forks source link

X-Duration-Seconds header is not set on function timeout #77

Closed ewilde closed 4 years ago

ewilde commented 4 years ago

If the original function invocation takes longer than than the functions combined read_timeout and write_timeout the X-Duration-Seconds header is not set on the callback function

Expected Behaviour

X-Duration-Seconds should be set on the callback function

Steps to Reproduce (for bugs)

  1. Create a function a , make is sleep for 10 seconds
  2. Create a callback function b that prints the X-Duration-Seconds header
  3. invoke function a i.e. curl http://127.0.0.1:8080/async-function/a -d 'hello' -H 'X-Callback-Url: http://gateway:8080/function/b'
ewilde commented 4 years ago

This may be expected behaviour, if it's not I guess the following high level fix:

Either

Or