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

connection-manager: assertion failure in simulation #4607

Closed
coot opened this issue Jun 22, 2023 · 1 comment · Fixed by #4623
Closed

connection-manager: assertion failure in simulation #4607

coot opened this issue Jun 22, 2023 · 1 comment · Fixed by #4623
Assignees
Labels
connection-manager Issues / PRs related to connection-manager test-failure a test failure

Comments

@coot
Copy link
Contributor

coot commented Jun 22, 2023

      no invalid traces:                                       FAIL (11285.69s)
        *** Failed! Falsified (after 91 tests and 38 shrinks):
        0
        ArbDataFlow Duplex
        AbsBearerInfo {abiConnectionDelay = SmallDelay, abiInboundAttenuation = NoAttenuation FastSpeed, abiOutboundAttenuation = NoAttenuation FastSpeed, abiInboundWriteFailure = Nothing, abiOutboundWriteFailure = Nothing, abiAcceptFailure = Nothing, abiSDUSize = LargeSDU}
        MultiNodeScript {mnsEvents = [StartClient 0s (TestAddr {unTestAddr = TestAddress (39)}),InboundConnection 0s (TestAddr {unTestAddr = TestAddress (39)}),InboundMiniprotocols 0s (TestAddr {unTestAddr = TestAddress (39)}) (TemperatureBundle {withHot = WithHot [], withWarm = WithWarm [], withEstablished = WithEstablished [0]}),ShutdownClientServer 0s (TestAddr {unTestAddr = TestAddress (39)}),StartServer 0s (TestAddr {unTestAddr = TestAddress (79)}) 0,StartServer 0s (TestAddr {unTestAddr = TestAddress (39)}) 0,OutboundConnection 0.1s (TestAddr {unTestAddr = TestAddress (39)}),OutboundConnection 0s (TestAddr {unTestAddr = TestAddress (79)}),CloseOutboundConnection 0s (TestAddr {unTestAddr = TestAddress (39)})], mnsAttenuationMap = fromList [(TestAddr {unTestAddr = TestAddress (39)},Script (AbsBearerInfo {abiConnectionDelay = SmallDelay, abiInboundAttenuation = NoAttenuation FastSpeed, abiOutboundAttenuation = SpeedAttenuation SlowSpeed (Time 56.2s) 154.7s, abiInboundWriteFailure = Nothing, abiOutboundWriteFailure = Just 5, abiAcceptFailure = Just (SmallDelay,AbsIOErrConnectionAborted), abiSDUSize = NormalSDU} :| []))]}
        ========== Script ==========
           0s: Start client TestAddr {unTestAddr = TestAddress (39)}
           0s: Connection from TestAddr {unTestAddr = TestAddress (39)}
           0s: Miniprotocols from TestAddr {unTestAddr = TestAddress (39)}: hot:[] warm:[] est:[0]
           0s: Shutdown client/server TestAddr {unTestAddr = TestAddress (39)}
           0s: Start server TestAddr {unTestAddr = TestAddress (79)} with accInit=0
           0s: Start server TestAddr {unTestAddr = TestAddress (39)} with accInit=0
         0.1s: Connecting to TestAddr {unTestAddr = TestAddress (39)}
         0.1s: Connecting to TestAddr {unTestAddr = TestAddress (79)}
         0.1s: Close connection to TestAddr {unTestAddr = TestAddress (39)}
        ========== ConnectionManager Events ==========
        TrIncludeConnection Outbound TestAddress (39)
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 0, unidirectionalConns = 0, inboundConns = 0, outboundConns = 0})
        TrConnectionNotFound Outbound TestAddress (39)
        TrConnect (Just TestAddress (0)) TestAddress (39)
        TrIncludeConnection Inbound TestAddress (39)
        TrConnectError (Just TestAddress (0)) TestAddress (39) Ouroboros.Network.Snocket.Sim.connect: already exists (Transport endpoint (FDUninitialised Just TestAddress (0)) is already connected)
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 0, unidirectionalConns = 0, inboundConns = 1, outboundConns = 0})
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 0, unidirectionalConns = 0, inboundConns = 1, outboundConns = 0})
        TrIncludeConnection Outbound TestAddress (79)
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 0, unidirectionalConns = 0, inboundConns = 1, outboundConns = 0})
        TrConnectionNotFound Outbound TestAddress (79)
        TrConnect (Just TestAddress (0)) TestAddress (79)
        TrConnectionHandler (ConnectionId {localAddress = TestAddress (0), remoteAddress = TestAddress (39)}) (TrHandshakeSuccess UnversionedProtocol (DataFlowProtocolData {getProtocolDataFlow = Unidirectional, getProtocolPeerSharing = NoPeerSharing}))
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 0, unidirectionalConns = 1, inboundConns = 1, outboundConns = 0})
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 0, unidirectionalConns = 1, inboundConns = 1, outboundConns = 0})
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 0, unidirectionalConns = 1, inboundConns = 1, outboundConns = 0})
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 0, unidirectionalConns = 1, inboundConns = 1, outboundConns = 0})
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 0, unidirectionalConns = 1, inboundConns = 1, outboundConns = 0})
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 0, unidirectionalConns = 1, inboundConns = 1, outboundConns = 0})
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 0, unidirectionalConns = 1, inboundConns = 1, outboundConns = 1})
        TrConnectionHandler (ConnectionId {localAddress = TestAddress (0), remoteAddress = TestAddress (79)}) (TrHandshakeSuccess UnversionedProtocol (DataFlowProtocolData {getProtocolDataFlow = Duplex, getProtocolPeerSharing = NoPeerSharing}))
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 1, unidirectionalConns = 1, inboundConns = 1, outboundConns = 1})
        TrUnregisterConnection Outbound TestAddress (39)
        TrUnexpectedlyFalseAssertion (UnregisterOutboundConnection (Just (ConnectionId {localAddress = TestAddress (0), remoteAddress = TestAddress (39)})) (InboundSt Unidirectional))
        TrForbiddenOperation TestAddress (39) (InboundSt Unidirectional)
        TrUnregisterConnection Inbound TestAddress (79)
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 1, unidirectionalConns = 1, inboundConns = 1, outboundConns = 1})
        TrConnectionHandler (ConnectionId {localAddress = TestAddress (0), remoteAddress = TestAddress (39)}) (TrConnectionHandlerError InboundError (MuxError MuxSDUReadTimeout "Mux SDU Timeout") ShutdownPeer)
        TrConnectionCleanup (ConnectionId {localAddress = TestAddress (0), remoteAddress = TestAddress (39)})
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 1, unidirectionalConns = 0, inboundConns = 0, outboundConns = 1})
        TrConnectionHandler (ConnectionId {localAddress = TestAddress (0), remoteAddress = TestAddress (79)}) (TrConnectionHandlerError OutboundError (MuxError MuxSDUReadTimeout "Mux SDU Timeout") ShutdownPeer)
        TrConnectionCleanup (ConnectionId {localAddress = TestAddress (0), remoteAddress = TestAddress (79)})
        TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 0, unidirectionalConns = 0, inboundConns = 0, outboundConns = 0})
        TrShutdown
        MainReturn (Time 3600.1s) () []
        TrUnexpectedlyFalseAssertion (UnregisterOutboundConnection (Just (ConnectionId {localAddress = TestAddress (0), remoteAddress = TestAddress (39)})) (InboundSt Unidirectional))
        Use --quickcheck-replay=266885 to reproduce.
        Use -p '/ConnectionManager.no invalid traces/' to rerun this test only.

ref

@coot coot added networking connection-manager Issues / PRs related to connection-manager test-failure a test failure labels Jun 22, 2023
@bolt12
Copy link
Contributor

bolt12 commented Jul 11, 2023

I think the problem here is that if one looks at the script we see:

(...) OutboundConnection 0.1s (TestAddr {unTestAddr = TestAddress (39)}),
(...),CloseOutboundConnection 0s (TestAddr {unTestAddr = TestAddress (39)}

which shouldn't happen

In this particular test we issue an inbound connection that makes progress and then we issue a close connection before the outbound connection has been established

bolt12 added a commit that referenced this issue Jul 12, 2023
bolt12 added a commit that referenced this issue Jul 12, 2023
@bolt12 bolt12 self-assigned this Jul 13, 2023
bolt12 added a commit that referenced this issue Sep 1, 2023
Fix #4607

In particular fix the delays of generated events in order to not lead to
wrong schedules
bolt12 added a commit that referenced this issue Sep 1, 2023
Fix #4607

In particular fix the delays of generated events in order to not lead to
wrong schedules
bolt12 added a commit that referenced this issue Sep 25, 2023
Fix #4607

In particular fix the delays of generated events in order to not lead to
wrong schedules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connection-manager Issues / PRs related to connection-manager test-failure a test failure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants