8000 Clear activity tags when retrying TLS. Fixes #1405 · mysql-net/MySqlConnector@e39d3b8 · GitHub
[go: up one dir, main page]

Skip to content

Commit e39d3b8

Browse files
committed
Clear activity tags when retrying TLS. Fixes #1405
1 parent 6a63fa4 commit e39d3b8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/MySqlConnector/Core/ServerSession.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,14 @@ public async Task DisposeAsync(IOBehavior ioBehavior, CancellationToken cancella
561561
{
562562
shouldRetrySsl = false;
563563
}
564+
565+
if (shouldRetrySsl)
566+
{
567+
// avoid "The collection already contains item with same key 'net.transport'" exception when retrying SSL
568+
m_activityTags.Remove(ActivitySourceHelper.NetTransportTagName);
569+
m_activityTags.Remove(ActivitySourceHelper.NetPeerNameTagName);
570+
m_activityTags.Remove(ActivitySourceHelper.NetPeerPortTagName);
571+
}
564572
} while (shouldRetrySsl);
565573

566574
if (m_supportsConnectionAttributes && cs.ConnectionAttributes is null)

0 commit comments

Comments
 (0)
0