Handle connection errors more gracefully

Created on 9 April 2024, over 1 year ago

Problem/Motivation

We're investigating a potential performance problem to do with a Webform API Handler integration. We would like to be able to tweak the timeout for the Handler's HTTP request in order to sure up the front-end experience while we investigate the root cause.

Steps to reproduce

  1. Create a Webform API handler.
  2. Set it to use an endpoint such as https://httpbin.org/delay/10 (will return after 10 seconds)
  3. Set your PHP timeout to less than the number of seconds specified
  4. Try submitting the form

Proposed resolution

Add configuration options to the Handler to allow setting the timeout to a specific number of seconds.

Remaining tasks

Implement the changes.

User interface changes

None.

API changes

None.

Data model changes

The timeout setting will need to be added to the Handler data model.

Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇦🇺Australia geoffreyr Sydney, AU / Gadigal country

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @geoffreyr
  • 🇦🇺Australia geoffreyr Sydney, AU / Gadigal country

    I've worked out that we can go to the Advanced tab and set, under Custom Options, something like timeout: 10. This works as intended, albeit that if that timeout is ever exceeded, it throws a fatal error that Webform module can't recover from. It looks like Guzzle is throwing a ConnectException on timeout, which isn't classed as a RequestException. This is also a problem with Webform's own RemotePostWebformHandler, but I don't see a reason why we shouldn't fix this here.

  • 🇦🇺Australia geoffreyr Sydney, AU / Gadigal country
  • Merge request !53439542: Handle Guzzle ConnectException → (Open) created by geoffreyr
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇦🇺Australia geoffreyr Sydney, AU / Gadigal country
Production build 0.71.5 2024