Skip to content

queue-worker crashes if callback happens and function call failed #90

@andeplane

Description

@andeplane

If function call ends up giving 503, nats-queue-worker crashes with panic: runtime error: invalid memory address or nil pointer dereference when trying to do callback if X-Callback-Url is set.

Expected Behaviour

It doesn't crash.

Current Behaviour

It crashes and pod dies.

Possible Solution

See #89

Steps to Reproduce (for bugs)

  1. Deploy OpenFaaS in GCP using marketplace (default timeout settings).
  2. Create function with the following handle, based on python3 template
import time
def handle(req):
    t = 60
    time.sleep(t)
    print(f"Slept for {t} seconds")
  1. Deploy function using default timeout settings faas up -f sleep.yml
  2. Do an async function call with callback to e.g. https://requestbin.com and watch the kubernetes logs for the queue worker and wait for the following error
    queueworker_crash.txt

Context

It started crashing some functions I thought failed for another reason.

Your Environment

Kubernetes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions