Skip to content

[Bug] Random error during start #4247

@shargon

Description

@shargon

Describe the bug

In my opinion, the issue that #4244 tried to fix wasn’t actually resolved — it was just hidden. As @Jim8y mentioned:

  • Peer.OnTcpConnected always assumed both the Akka Tcp.Connected envelope and
    the actor’s Config field were ready. In practice that’s not guaranteed:
  • Akka can deliver a Tcp.Connected message whose RemoteAddress is null when
    the socket aborts during the OS handshake. The old code immediately cast
    that to IPEndPoint and called .UnMap(), so the very first dereference blew
    up with a NullReferenceException.
  • There’s also a race between wiring up ChannelsConfig (handled in OnStart)
    and the inflight connect that triggers Tcp.Connected. When the connect
    arrived before OnStart ran, Config was still null, and the subsequent
    Config.MaxConnections… lookup faulted.

We should try to find the root cause of the problem instead of hiding it.

Metadata

Metadata

Assignees

Labels

BugUsed to tag confirmed bugsUnder InvestigationThe problem mentioned, or possible improvement, is under investigation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions