opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

[dv,tcp_server] avoid conn-related assertion

Open kwalker27 opened this issue 7 months ago • 3 comments

Treat more errors from read/send as non-fatal, just closing the connection and allowing a new client to attach. It's preferable to avoid assertions for runtime conditions that are potentially recoverable.

kwalker27 avatar Jun 12 '25 14:06 kwalker27

@luismarques Potentially someone from the SW team has related expertise and could review this?

andreaskurth avatar Jun 13 '25 06:06 andreaskurth

What error code are you observing? ECONNRESET? I'd prefer to add relevant error codes instead of silently treating all error codes as network issues.

Also -- read with 0 bytes returned means graceful disconnection from other side -- we should probably treat as such. (although this is an issue with existing code)

nbdd0121 avatar Jun 16 '25 15:06 nbdd0121

What error code are you observing? ECONNRESET? I'd prefer to add relevant error codes instead of silently treating all error codes as network issues.

Also -- read with 0 bytes returned means graceful disconnection from other side -- we should probably treat as such. (although this is an issue with existing code)

Yes, one case was definitely ECONNRESET. I can add the 0 return value handling. I guess I still wonder which other possible errno values from read and send would warrant an assertion that blows up our emulation model, which is a shared and long-running resource.

kwalker27 avatar Jun 17 '25 00:06 kwalker27