Skip to content

Conversation

@FelixTing
Copy link
Member

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/go-mod-bootstrap/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

FelixTing and others added 3 commits October 14, 2025 14:53
…gexfoundry#881)

- Use the current service writable config as the baseline for the initial update
- Store previousCommonWritable as map to avoid pointer reference syncing with Config Provider

Signed-off-by: FelixTing <[email protected]>
fixes edgexfoundry#872

The send on close channel panic are occasionally observed when a service is terminated.
The root cause is that go-mod-bootstrap implements listensForChanges by creating sender
channel in the side of receiver, and close the sender channel in the side of receiver
will cause the panic.

The simplest solution with least code refactor is to not defer close(updateStream) and
defer close(errorStream) in listenForPrivateChanges, listenForCommonChanges, and
ListenForCustomChanges since there is no need to close the channels.

Moreover, edgexfoundry#814 accidentally adds
reduandant calls to listen for changes on Writable.
As the `cp.loadConfigByProvider` will listen for changes on Writable at https://github.com/edgexfoundry/go-mod-bootstrap/pull/814/files#diff-5346c73553fe1e8350deb1a29ed066b1202c1ea35e57d206adbb6f359ed1d299R332-R343, there is no need to do it again at https://github.com/edgexfoundry/go-mod-bootstrap/pull/814/files#diff-5346c73553fe1e8350deb1a29ed066b1202c1ea35e57d206adbb6f359ed1d299R181-R192.

This fix also removes this redundant calls.

Signed-off-by: Jude Hung <[email protected]>
@FelixTing FelixTing requested a review from judehung October 14, 2025 11:10
@codecov-commenter
Copy link

codecov-commenter commented Oct 14, 2025

Codecov Report

❌ Patch coverage is 0% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.10%. Comparing base (3425910) to head (7a006e5).

Files with missing lines Patch % Lines
bootstrap/config/config.go 0.00% 39 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           odessa     #910      +/-   ##
==========================================
- Coverage   46.21%   46.10%   -0.12%     
==========================================
  Files          62       62              
  Lines        3659     3668       +9     
==========================================
  Hits         1691     1691              
- Misses       1846     1855       +9     
  Partials      122      122              

☔ View full report in Codecov by Sentry.
📢 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.

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.

3 participants