-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
1-lowpriority denoting isolated changespriority denoting isolated changesholdIntended for PRs we want to flag for ongoing reviewIntended for PRs we want to flag for ongoing review
Description
I started noticing that the time to retry reader connections was becoming increasingly long the more times you connect/disconnect cycle the readers without restarting the device service.
I added extra printouts to the following code in order to track it down a little better
Snippet of interest which shows what i am referring to:
2021/06/29 16:53:42 retry attempt: 5, wait: 2m5s
level=DEBUG ts=2021-06-29T23:55:47.365787007Z app=edgex-device-rfid-llrp source=device.go:151 device=SpeedwayR-11-25-D6 msg="Attempting LLRP Client connection."
level=INFO ts=2021-06-29T23:55:47.366315604Z app=edgex-device-rfid-llrp source=device.go:470 device=SpeedwayR-11-25-D6 msg="Device connection restored."
...
level=ERROR ts=2021-06-29T23:56:45.720013566Z app=edgex-device-rfid-llrp source=device.go:166 error="failed to get next message: failed to read header: EOF" device=SpeedwayR-11-25-D6 msg="Client disconnected unexpectedly."
2021/06/29 16:56:45 retry attempt: 1, wait: 0s
level=DEBUG ts=2021-06-29T23:56:45.720256459Z app=edgex-device-rfid-llrp source=device.go:139 address=10.0.0.53:5084 device=SpeedwayR-11-25-D6 msg="Attempting to dial Reader."
level=ERROR ts=2021-06-29T23:56:45.720555502Z app=edgex-device-rfid-llrp source=device.go:144 error="dial tcp 10.0.0.53:5084: connect: connection refused" address=10.0.0.53:5084 device=SpeedwayR-11-25-D6 msg="Failed to dial Reader."
2021/06/29 16:56:45 retry attempt: 6, wait: 3m15s
Explanation:
-
Notice that 2 mins go by waiting for attempt 5 (
retry.Slow), when it is able to successfully reconnect. -
A little while later the connection is dropped and immediately, the
retry.Quickattempts to reconnect and fails (retry attempt: 1, wait: 0s). -
After this the
retry.Slowwaits for attempt 6 for over 3 minutes.- Because the connection was restored after attempt 5, the
retry.Slowshould be reset back to attempt 1, or at least the back-off time should be reset.
- Because the connection was restored after attempt 5, the
Metadata
Metadata
Assignees
Labels
1-lowpriority denoting isolated changespriority denoting isolated changesholdIntended for PRs we want to flag for ongoing reviewIntended for PRs we want to flag for ongoing review
Type
Projects
Status
Icebox