Forge functions in the nodejs runtime may timeout due to closed socket for HTTP requests with a body

XMLWordPrintable

    • Minor

      Issue Summary

      Forge functions that make a request that consumes a payload may timeout and throw an error by the retry proxy if the original request threw an error.

      This is fairly difficult to reproduce consistently. It requires multiple requests that may timeout.

      The symptoms include

      1. The Forge invoke() method starts to time out
      2. Seeing HTTP 503 errors in the logs

      Steps to Reproduce

      1. Run a forge function in the nodejs18 runtime that makes an external request that might timeout
      2. Rinse and repeat until failures start

      Expected Results

      The consuming stream is reset and the request is retried correctly.

      Actual Results

      The below exception is thrown in the developer log file:

      Error: unexpected status code 503
          at doThing (webpack://app-package/src/issue-events.js:62:11)
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
          at processAttachment (webpack://app-package/src/issue-events.js:72:5)
          at Object.exports.run (webpack://app-package/src/issue-events.js:80:7)
          at async t.<computed> [as handler] (/var/task/issue-events.cjs:2:164737) 

      and

      upstream connect error or disconnect/reset before headers. reset reason: connection termination
      

       

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            Assignee:
            Sam Smyth
            Reporter:
            James Richards
            Votes:
            13 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: