Skip to content

Conversation

@sgscheffler
Copy link
Contributor

Fix JENKINS-76283: httpRequest ignores default timeout 0 and enforces 5 minutes

When the timeout parameter is not provided or set to 0 (documented as 'no timeout'), httpclient5 was using its default 5-minute timeout instead.

This fixes the regression introduced in v1.22 during the httpclient5 migration (PR #197) by explicitly setting timeout to DISABLED when timeout <= 0, restoring the documented behavior.

Issue Description

According to the official documentation, the timeout parameter should default to 0, meaning "no timeout". However, starting from version 1.22, when the timeout parameter is not provided, requests fail after approximately 5 minutes, indicating that a default timeout is being applied.

This regression was introduced during the httpclient5 migration in PR #197. In httpclient4, not setting a RequestConfig meant infinite timeout. In httpclient5, if no RequestConfig is explicitly set, it uses a default timeout of 5 minutes.

Changes Made

Modified HttpRequestExecution.java in the configureTimeoutAndSsl() method to explicitly set timeout to Timeout.DISABLED when timeout <= 0, ensuring the documented "no timeout" behavior is restored.

Testing done

  • Existing Tests: All existing automated tests pass successfully (mvn clean verify)
  • Manual Testing: Verified that when timeout is not specified or set to 0, the HTTP request now waits indefinitely as documented
  • Regression Testing: Verified that explicitly setting timeout values (e.g., timeout: 30) still works correctly and times out after the specified duration
  • Code Review: Confirmed that the fix addresses the root cause identified in the httpclient5 migration

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

Related Links

… 5 minutes

When the timeout parameter is not provided or set to 0 (documented as
'no timeout'), httpclient5 was using its default 5-minute timeout instead.

This fixes the regression introduced in v1.22 during the httpclient5
migration (PR jenkinsci#197) by explicitly setting timeout to DISABLED when
timeout <= 0, restoring the documented behavior.
@sgscheffler sgscheffler requested a review from a team as a code owner November 12, 2025 13:05
@MarkEWaite MarkEWaite added the bug label Nov 12, 2025
@MarkEWaite MarkEWaite enabled auto-merge (squash) November 13, 2025 05:17
@MarkEWaite MarkEWaite merged commit 5382dc0 into jenkinsci:master Nov 13, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants