Repository navigation
fix(scanner): ErrNotConnected when the session ends after Forward_Open (v0.8.3) - #34
Merged
Merged
Conversation
…n (v0.8.3)
Open took the target's address from the client's session after the
Forward_Open reply. When the session had ended in between, the address
was nil and the I/O connection was refused with ErrInvalidOption
("production without an interval or destination"), an error about the
configuration. Open now reports ErrNotConnected and tries the
Forward_Close, as on its other failures after a Forward_Open. The chaos
test of e2e met this on the pin pass pull request #33 (ci, Lint &
Coverage), as a connection killed at that moment.
TestOpenSessionEndedAfterForwardOpen ends the session at that step
through a package variable (remoteAddr) and fails without the fix with
the error CI saw.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scanner.Opentook the target's address from the client's session after the Forward_Open reply. When the session had ended in between,RemoteAddrwas nil, and the I/O connection was refused withErrInvalidOption("production without an interval or destination"). That error is about the configuration, but the cause is a lost connection.Opennow reportsErrNotConnected(ERRORS.md: no registered session) and tries the Forward_Close, as on its other failures after a Forward_Open.The chaos test of
e2emet this on theLint & Coveragejob of #33 (a pin pass pull request that changes only the docsync version), with a connection killed at that moment (ETHERNETIP_CHAOS_SEED=1794795094999956670; the seed alone doesn't reproduce it, the timing matters too).Changes
scanner/scanner.go: the target's address is checked before the I/O connection is opened;remoteAddr(unexported) is the seam the test uses.TestOpenSessionEndedAfterForwardOpen: a session that has ended after the reply givesErrNotConnected, notErrInvalidOption, and one Forward_Close. It fails without the fix with the error CI saw.v0.8.3(patch; no exported identifier changes). After the merge the release workflow publishes it. ethernetipctl and ethernetip-interop's own module then move to v0.8.3.Checks run locally
go test -race -count=1 ./scanner ./e2e: pass. The new test without the fix fails as expected.golangci-lint run ./scanner: 0 issues.go vet ./scanner: clean.bin/verify.sh:policy=compliant docs=ok build+vet=ok.🤖 Generated with Claude Code