Skip to content

fix: get connection timeout values from config#270

Open
stevecl5 wants to merge 1 commit intomasterfrom
scl/connection-timeout-fix
Open

fix: get connection timeout values from config#270
stevecl5 wants to merge 1 commit intomasterfrom
scl/connection-timeout-fix

Conversation

@stevecl5
Copy link
Copy Markdown
Contributor

@stevecl5 stevecl5 commented May 2, 2026

Summary of Changes

Fixed a bug where connection timeout configurations defined in gateway.yaml were being ignored during application startup.

Previously, even if connectTimeout and requestTimeout were provided in the configuration file, they were not being mapped to the AccessorConnectionSettings, resulting in those values remaining null and having no effect on connection requests. This change updates ConnectionBinder to correctly extract those strings from the configuration map, parse them using Durations.fromCompactString(), and apply them to the underlying connection settings.

Additionally, I fixed an issue with Fields.coerceValueType where it would fail to coerce Duration values if the value was already a Duration type. I added the following code after the null check to handle any values that don't need to be coerced because they are already of the desired type. This also provides a small performance improvement, since no additional processing is required to "coerce" a value unnecessarily.

    if (targetType == value.getClass()) {
      return value;
    }

Fixes GCU-1311

Public API Additions/Changes

None

Downstream Consumer Impact

Downstream consumers will now see their configured connectTimeout and requestTimeout values actively applied to connections. Previously, these settings were silently ignored.

Additionally, consumers should be aware that if an invalid duration string is provided in the configuration file, the application will now fail-fast during Spring Boot initialization by throwing a ConfigurationException detailing the invalid format.

How Has This Been Tested?

TBA

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant