Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP Broken pipe on disconnect / reconnect #606

Open
souyamafountlab opened this issue Jan 15, 2025 · 1 comment
Open

TCP Broken pipe on disconnect / reconnect #606

souyamafountlab opened this issue Jan 15, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@souyamafountlab
Copy link

souyamafountlab commented Jan 15, 2025

🐞 Bug Report

Affected Services [REQUIRED]

The issue is located in: device-modbus-go

Is this a regression?

Kinda.

The code at v3.1 used to open and close connection for each read request, which would give problems at high freqnency polls for certain devices. The current fix of using a client map keeps a persistent connection. Now in case the connection ever drops even temporarily, read/write requests fails until the container is restarted.

Description and Minimal Reproduction [REQUIRED]

Connect any modbus device over TCP and start polling such as through autoevents. Disconnect and reconnect the device to the network.

🔥 Exception or Error


level=ERROR ts=2025-01-15T11:51:55.458149687Z app=device-modbus source=executor.go:55 msg="AutoEvent - error occurs when reading resource DI8: error reading Regex DeviceResource(s) DI8 for DVC_1 -> write tcp 172.18.0.10:55972->XXX.XXX.XXX.XXX:502: write: broken pipe"
2025/01/15 17:21:55 modbus: sending 0b 32 00 00 00 06 03 02 00 0d 00 01
level=INFO ts=2025-01-15T11:51:55.459155047Z app=device-modbus source=driver.go:137 msg="Read command failed. Cmd:DI13 err:write tcp 172.18.0.10:55972->XXX.XXX.XXX.XXX:502: write: broken pipe \n"
level=ERROR ts=2025-01-15T11:51:55.459204454Z app=device-modbus source=executor.go:55 msg="AutoEvent - error occurs when reading resource DI13: error reading Regex DeviceResource(s) DI13 for DVC_1 -> write tcp 172.18.0.10:55972->XXX.XXX.XXX.XXX:502: write: broken pipe"
2025/01/15 17:21:55 modbus: sending 0b 33 00 00 00 06 03 02 00 0c 00 01
level=INFO ts=2025-01-15T11:51:55.459254348Z app=device-modbus source=driver.go:137 msg="Read command failed. Cmd:DI12 err:write tcp 172.18.0.10:55972->XXX.XXX.XXX.XXX:502: write: broken pipe \n"
level=ERROR ts=2025-01-15T11:51:55.459301749Z app=device-modbus source=executor.go:55 msg="AutoEvent - error occurs when reading resource DI12: error reading Regex DeviceResource(s) DI12 for DVC_1 -> write tcp 172.18.0.10:55972->XXX.XXX.XXX.XXX:502: write: broken pipe"
2025/01/15 17:21:55 modbus: sending 0b 34 00 00 00 06 03 02 00 09 00 01
level=INFO ts=2025-01-15T11:51:55.459347214Z app=device-modbus source=driver.go:137 msg="Read command failed. Cmd:DI9 err:write tcp 172.18.0.10:55972->XXX.XXX.XXX.XXX:502: write: broken pipe \n"

🌍 Your Environment

Deployment Environment:

EdgeX Version [REQUIRED]:
Latest code at commit 2f075c7

Anything else relevant?

@souyamafountlab souyamafountlab added the bug Something isn't working label Jan 15, 2025
@github-project-automation github-project-automation bot moved this to New Issues in Technical WG Jan 23, 2025
@cloudxxx8
Copy link
Member

If the command is failed, the connection should be removed from the cache to allow re-establish connection next time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: New Issues
Development

No branches or pull requests

2 participants