refactor(csharp): cleanup tcp connection after vsr implementation - #3858
refactor(csharp): cleanup tcp connection after vsr implementation#3858lukaszzborek wants to merge 10 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3858 +/- ##
============================================
- Coverage 82.84% 81.93% -0.92%
Complexity 1299 1299
============================================
Files 1199 1200 +1
Lines 161885 161835 -50
Branches 131360 131473 +113
============================================
- Hits 134120 132595 -1525
- Misses 24225 25644 +1419
- Partials 3540 3596 +56
🚀 New features to boost your workflow:
|
|
If possible, merge #3836 first. Then I will remove things with namespace which I refactoring 😅 |
hubcio
left a comment
There was a problem hiding this comment.
solid direction overall - classic framing gone, the VsrConnection extraction, typed namespaces and the epoch rejoin are real improvements. blocking items are the probe losing its reconnect, the never-nulled _connection, the fail-open namespace and the edge-based Disconnected clear; the rest is small.
one thing outside the diff: SetConnectionStateAsync (TcpMessageStream.cs:1153) is a non-atomic check-then-set with the publish after the write, reachable from callers holding different locks - concurrent transitions can publish duplicates or a PreviousState that never actually preceded CurrentState. it predates this PR, and fixing it properly means moving the publish behind an ordered queue (holding a lock across the publish is not an option - the handler chain runs synchronously into socket I/O when the semaphores are uncontended, so a sync write fault re-enters the same lock). follow-up material, but it is the substrate under the Disconnected-clear race flagged inline.
# Conflicts: # foreign/csharp/Iggy_SDK/Vsr/VsrHeader.cs # foreign/csharp/Iggy_SDK/Vsr/VsrNamespace.cs # foreign/csharp/Iggy_SDK_Tests/VsrTests/VsrHeaderTests.cs # foreign/csharp/Iggy_SDK_Tests/VsrTests/VsrNamespaceTests.cs
# Conflicts: # foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs
6ce3fe0 to
a68c9b0
Compare
…synchronous calls
Follow-up cleanup of the .NET SDK TCP transport after the VSR support landed