Skip to content

Commit 320a007

Browse files
committed
Stop recycling MySqlDataReader instances. Fixes #1459
1 parent a7987ab commit 320a007

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/MySqlConnector/Core/ConnectionPool.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public async ValueTask ReturnAsync(IOBehavior ioBehavior, ServerSession session)
173173
_ = m_leasedSessions.Remove(session.Id);
174174
MetricsReporter.RemoveUsed(this);
175175
session.OwningConnection = null;
176+
session.DataReader = new();
176177
var sessionHealth = GetSessionHealth(session);
177178
if (sessionHealth == 0)
178179
{

src/MySqlConnector/Core/ServerSession.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public ServerSession(ILogger logger, ConnectionPool? pool, int poolGeneration, i
6969
public bool SupportsSessionTrack { get; private set; }
7070
public bool ProcAccessDenied { get; set; }
7171
public ICollection<KeyValuePair<string, object?>> ActivityTags => m_activityTags;
72-
public MySqlDataReader DataReader { get; }
72+
public MySqlDataReader DataReader { get; set; }
7373

7474
public ValueTask ReturnToPoolAsync(IOBehavior ioBehavior, MySqlConnection? owningConnection)
7575
{

0 commit comments

Comments
 (0)