Skip to content

Conversation

@marcb-dame
Copy link

@marcb-dame marcb-dame commented Oct 30, 2025

network issues for one device impacts data gathering of all devices. Fixes #666

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/device-modbus-go/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?)

Testing Instructions

You need to have a (mock) device with network issue causing timeouts (for example, say 10s timeout). And a second device without network issues which you are gathering data from frequently, say 1s

New Dependency Instructions (If applicable)

Copy link
Member

@cloudxxx8 cloudxxx8 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@cloudxxx8 cloudxxx8 left a comment

Choose a reason for hiding this comment

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

the code change looks good to me, but please modify the commit message and PR title to meet sematic PR check

fix: avoid single conn blocking other device conn

Also, please sign your commit to meet DCO check

Comment on lines +39 to +42

d.clientMutex.Lock()
c, ok := d.clientMap[key]
d.clientMutex.Unlock()
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be better to convert this into RWMutex and use RLock here?

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.

Connectivity issues with one device impacts data gathering from all other devices

3 participants