Skip to content

refactor: align timeout budget with wsman client for slow devices - #1153

Merged
amarnath-ac merged 1 commit into
mainfrom
1082_device_details_en_off_fix
Aug 24, 2026
Merged

refactor: align timeout budget with wsman client for slow devices#1153
amarnath-ac merged 1 commit into
mainfrom
1082_device_details_en_off_fix

Conversation

@amarnath-ac

@amarnath-ac amarnath-ac commented Jul 23, 2026

Copy link
Copy Markdown
Contributor
  1. httpserver read/write timeout 15s to 40s so the wsman client (30s) times out first with a clean 504.
  2. waitForAuth 3s to 30s so concurrent handlers share one Target instead of forking, preserving the library concurrency cap.
  3. expireAfter 30s to 60s to keep the authenticated Target cached across rapid page refreshes.

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.51%. Comparing base (cc951f4) to head (b19284c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1153      +/-   ##
==========================================
+ Coverage   50.45%   50.51%   +0.05%     
==========================================
  Files         148      148              
  Lines       13739    13739              
==========================================
+ Hits         6932     6940       +8     
+ Misses       6211     6202       -9     
- Partials      596      597       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@amarnath-ac
amarnath-ac force-pushed the 1082_device_details_en_off_fix branch from 30dcd5a to acbd654 Compare July 28, 2026 15:49
@amarnath-ac amarnath-ac changed the title fix: update to transport timeouts fix: align timeout budget with wsman client for slow devices Jul 28, 2026
@amarnath-ac
amarnath-ac marked this pull request as ready for review July 28, 2026 15:58
@amarnath-ac
amarnath-ac requested a review from a team as a code owner July 28, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts timeout and caching budgets so slow WSMAN operations are more likely to fail via the WSMAN client timeout (clean 504) rather than being cut off by the HTTP server or by duplicate concurrent authentication attempts.

Changes:

  • Increase default HTTP server timeouts to allow longer-running handlers.
  • Increase WSMAN connection-cache expiry to keep authenticated targets cached longer.
  • Increase the “wait for auth” window to reduce concurrent handlers forking multiple WSMAN clients for the same device.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pkg/httpserver/server.go Updates default HTTP server timeouts to a larger budget.
internal/usecase/devices/wsman/message.go Extends WSMAN connection cache TTL and auth-wait window to reduce duplicate client creation and keep targets warm longer.

Comment thread pkg/httpserver/server.go
Comment thread internal/usecase/devices/wsman/message.go Outdated
Comment thread internal/usecase/devices/wsman/message.go
@sudhir-intc sudhir-intc changed the title fix: align timeout budget with wsman client for slow devices refactor: align timeout budget with wsman client for slow devices Aug 17, 2026
sudhir-intc
sudhir-intc previously approved these changes Aug 17, 2026
@amarnath-ac
amarnath-ac force-pushed the 1082_device_details_en_off_fix branch from faf6a06 to 0adadb2 Compare August 18, 2026 13:27
@amarnath-ac
amarnath-ac force-pushed the 1082_device_details_en_off_fix branch from 0adadb2 to 78a6b6e Compare August 18, 2026 14:03
1. httpserver read/write timeout 15s to 40s so the wsman client
  (30s) times out first with a clean 504.
2. waitForAuth 3s to 30s so concurrent handlers share one Target
   instead of forking, preserving the library concurrency cap.
3. expireAfter 30s to 60s to keep the authenticated Target cached
   across rapid page refreshes.
@amarnath-ac
amarnath-ac force-pushed the 1082_device_details_en_off_fix branch from 686a73e to b19284c Compare August 24, 2026 16:37
@amarnath-ac
amarnath-ac merged commit 374987e into main Aug 24, 2026
21 checks passed
@amarnath-ac
amarnath-ac deleted the 1082_device_details_en_off_fix branch August 24, 2026 16:51
@RosieAMT

Copy link
Copy Markdown

🎉 This PR is included in version 1.40.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

sudhir-intc added a commit that referenced this pull request Aug 25, 2026
commit 7e5511e
Merge: 86d029f c28d7a3
Author: Sudhir Pola <sudhir.pola@intel.com>
Date:   Tue Aug 25 10:10:48 2026 +0530

    Merge branch 'main' into feat/http-tenant-header

commit c28d7a3
Author: Madhavi Losetty <madhavi.losetty@intel.com>
Date:   Mon Aug 24 10:16:23 2026 -0700

    refactor(config): check admin password strength at startup (#1193)

    Warn when the configured admin password is shorter than 8 characters
    or misses a lowercase letter, uppercase letter, digit, or symbol.
    Startup continues either way.

    Generated passwords now draw one character from each required class
    and shuffle with crypto/rand, so a fresh install satisfies the same
    rule the warning describes.

    The generator draws its symbols from @ and * only, because the value
    gets pasted verbatim into files that mangle punctuation: $ and !
    expand in sh, # truncates the value in make (the Makefile does
    -include .env, where quoting does not help), and % ^ & break
    cmd.exe's set. Operators may still use any of those themselves.

    There is no upper length bound, and any non-alphanumeric counts as a
    symbol: this password is only compared against the login request, so
    a long passphrase or one using - or _ must not be called weak.

    Existing passwords are untouched: the generator only runs when no
    password is configured, and a weak value only warns.

    Co-authored-by: Ganesh Raikhelkar <ganesh.raikhelkar@intel.com>

commit 374987e
Author: Amarnath C <amarnath.c@intel.com>
Date:   Mon Aug 24 22:21:20 2026 +0530

    fix: align timeout budget with wsman client for slow devices (#1082) (#1153)

    1. httpserver read/write timeout 15s to 40s so the wsman client
      (30s) times out first with a clean 504.
    2. waitForAuth 3s to 30s so concurrent handlers share one Target
       instead of forking, preserving the library concurrency cap.
    3. expireAfter 30s to 60s to keep the authenticated Target cached
       across rapid page refreshes.

commit cc951f4
Author: Amarnath C <amarnath.c@intel.com>
Date:   Mon Aug 24 22:06:36 2026 +0530

    build(deps): bump go-wsman-messages to v2.50.2 (#1219)

    Bumps go-wsman-messages from v2.50.1 to v2.50.2.

commit 3022f37
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Aug 24 06:41:41 2026 -0700

    build(deps): bump golang from 1.26-alpine to 1.27-alpine (#1215)

    Bumps golang from 1.26-alpine to 1.27-alpine.

    ---
    updated-dependencies:
    - dependency-name: golang
      dependency-version: 1.27-alpine
      dependency-type: direct:production
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Madhavi Losetty <madhavi.losetty@intel.com>

commit f455536
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Aug 24 06:27:30 2026 -0700

    build(deps): bump github.com/getkin/kin-openapi from 0.146.0 to 0.147.0 (#1216)

    Bumps [github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi) from 0.146.0 to 0.147.0.
    - [Release notes](https://github.com/getkin/kin-openapi/releases)
    - [Commits](getkin/kin-openapi@v0.146.0...v0.147.0)

    ---
    updated-dependencies:
    - dependency-name: github.com/getkin/kin-openapi
      dependency-version: 0.147.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Madhavi Losetty <madhavi.losetty@intel.com>

commit 4cfb69f
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Aug 24 06:17:22 2026 -0700

    build(deps): bump modernc.org/sqlite from 1.56.0 to 1.57.0 (#1217)

    Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.56.0 to 1.57.0.
    - [Changelog](https://gitlab.com/cznic/sqlite/blob/master/CHANGELOG.md)
    - [Commits](https://gitlab.com/cznic/sqlite/compare/v1.56.0...v1.57.0)

    ---
    updated-dependencies:
    - dependency-name: modernc.org/sqlite
      dependency-version: 1.57.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 356828b
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Aug 24 06:12:50 2026 -0700

    build(deps): bump the codeql-action group with 4 updates (#1218)

    Bumps the codeql-action group with 4 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action), [github/codeql-action/analyze](https://github.com/github/codeql-action) and [github/codeql-action/upload-sarif](https://github.com/github/codeql-action).

    Updates `github/codeql-action/init` from 4.37.7 to 4.37.8
    - [Release notes](https://github.com/github/codeql-action/releases)
    - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
    - [Commits](github/codeql-action@ff2f1c6...db488dd)

    Updates `github/codeql-action/autobuild` from 4.37.7 to 4.37.8
    - [Release notes](https://github.com/github/codeql-action/releases)
    - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
    - [Commits](github/codeql-action@ff2f1c6...db488dd)

    Updates `github/codeql-action/analyze` from 4.37.7 to 4.37.8
    - [Release notes](https://github.com/github/codeql-action/releases)
    - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
    - [Commits](github/codeql-action@ff2f1c6...db488dd)

    Updates `github/codeql-action/upload-sarif` from 4.37.7 to 4.37.8
    - [Release notes](https://github.com/github/codeql-action/releases)
    - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
    - [Commits](github/codeql-action@ff2f1c6...db488dd)

    ---
    updated-dependencies:
    - dependency-name: github/codeql-action/init
      dependency-version: 4.37.8
      dependency-type: direct:production
      update-type: version-update:semver-patch
      dependency-group: codeql-action
    - dependency-name: github/codeql-action/autobuild
      dependency-version: 4.37.8
      dependency-type: direct:production
      update-type: version-update:semver-patch
      dependency-group: codeql-action
    - dependency-name: github/codeql-action/analyze
      dependency-version: 4.37.8
      dependency-type: direct:production
      update-type: version-update:semver-patch
      dependency-group: codeql-action
    - dependency-name: github/codeql-action/upload-sarif
      dependency-version: 4.37.8
      dependency-type: direct:production
      update-type: version-update:semver-patch
      dependency-group: codeql-action
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 7e02b81
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Aug 21 11:57:47 2026 -0700

    build(deps): bump github.com/stretchr/testify from 1.12.0 to 1.12.1 (#1213)

    Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.12.0 to 1.12.1.
    - [Release notes](https://github.com/stretchr/testify/releases)
    - [Commits](stretchr/testify@v1.12.0...v1.12.1)

    ---
    updated-dependencies:
    - dependency-name: github.com/stretchr/testify
      dependency-version: 1.12.1
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 6e0906e
Author: Natalie Gaston <natalie.gaston@intel.com>
Date:   Thu Aug 20 18:38:13 2026 -0700

    fix(config): validate HTTP port and harden Windows browser launch (#1198)

commit a493e12
Author: Sinchana S R <sinchana.s.r@intel.com>
Date:   Fri Aug 21 04:18:50 2026 +0530

    refactor(api): prevent integer overflow in query parameters (#1180)

    * Add validation to prevent integer overflow in query parameters (top, skip, count).
    * Returns 400 instead of 500 on invalid input.

    Co-authored-by: Sudhir Pola <sudhir.pola@intel.com>

commit fe0cf5c
Author: ShradhaGupta31 <shradha.gupta@intel.com>
Date:   Fri Aug 21 04:14:50 2026 +0530

    refactor: reject JWT expiration value at startup if less than 1 sec (#1172)

    - Modified config.go to validate jwtExpiration while console startup
    - Reject non-positive values of jwtExpiration

    Signed-off-by: ShradhaGupta31 <shradha.gupta@intel.com>
    Co-authored-by: Madhavi Losetty <madhavi.losetty@intel.com>
    Co-authored-by: Ganesh Raikhelkar <ganesh.raikhelkar@intel.com>

commit 365531d
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Aug 20 22:38:15 2026 +0000

    build(deps): bump github.com/stretchr/testify from 1.11.1 to 1.12.0 (#1205)

    Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.11.1 to 1.12.0.
    - [Release notes](https://github.com/stretchr/testify/releases)
    - [Commits](stretchr/testify@v1.11.1...v1.12.0)

    ---
    updated-dependencies:
    - dependency-name: github.com/stretchr/testify
      dependency-version: 1.12.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Natalie Gaston <natalie.gaston@intel.com>

commit 4c585b1
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Aug 20 15:35:21 2026 -0700

    build(deps): bump step-security/harden-runner from 2.20.1 to 2.21.0 (#1208)

    Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.20.1 to 2.21.0.
    - [Release notes](https://github.com/step-security/harden-runner/releases)
    - [Commits](step-security/harden-runner@b09bb98...05e3151)

    ---
    updated-dependencies:
    - dependency-name: step-security/harden-runner
      dependency-version: 2.21.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: DevipriyaS17 <devipriya.s@intel.com>

commit 9414597
Author: DevipriyaS17 <devipriya.s@intel.com>
Date:   Fri Aug 21 04:00:43 2026 +0530

    build(docker): default dev service port bindings to loopback (#1168)

    * build(docker): default dev service port bindings to loopback

    * build(docker): address review comments

    ---------

    Co-authored-by: Sudhir Pola <sudhir.pola@intel.com>

commit 001de52
Author: DevipriyaS17 <devipriya.s@intel.com>
Date:   Fri Aug 21 03:57:13 2026 +0530

    refactor(security): default useTLS to true on device creation (#1169)

    * fix(security): default useTLS to true on device creation

    * fix: add code coverage

    * refactor(security): address review comments

    * refactor(security): fix the codeql error

    ---------

    Co-authored-by: Ganesh Raikhelkar <ganesh.raikhelkar@intel.com>

commit 3003aa0
Author: Madhavi Losetty <madhavi.losetty@intel.com>
Date:   Thu Aug 20 15:20:56 2026 -0700

    refactor: address golangci-lint 2.13.1 findings (#1212)

commit 60d074d
Author: Madhavi Losetty <madhavi.losetty@intel.com>
Date:   Thu Aug 20 13:02:13 2026 -0700

    refactor(config): move config to user dir and enforce owner-only perms (#1078)

    Relocate config to the user directory and harden seedConfig error
    handling, enforcing owner-only file permissions.

    Co-authored-by: MadhaviLosetty <madhavi.losetty@gmail.com>
@RosieAMT

Copy link
Copy Markdown

🎉 This PR is included in version 1.40.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@RosieAMT

Copy link
Copy Markdown

🎉 This PR is included in version 1.40.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

3 similar comments
@RosieAMT

RosieAMT commented Sep 2, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.40.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@RosieAMT

RosieAMT commented Sep 2, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.40.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@RosieAMT

RosieAMT commented Sep 4, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.40.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

5 participants