Bug #97248 .Net Driver consume huge memory when connection timeout
Submitted: 16 Oct 2019 7:46 Modified: 5 Jun 2020 13:38
Reporter: ybb huang Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:6.9.10 OS:Any (centos7)
Assigned to: CPU Architecture:Any (x86_64)
Tags: Memory, NextResult, timeout

[16 Oct 2019 7:46] ybb huang
Description:
Cyclic  call  `MySqlDataReader.NextResult`  when connection timeout,

cause second executing of MySqlDataReader.NextResult take last EOF packet  of resultset as the next resulset's  fileds num, get a big number filedCont, then new huge number of MySqlFileds;

How to repeat:

It' hard, maybe add a unit test;

Suggested fix:
resultSet = driver.NextResult(Statement.StatementId, false);

do not call MySqlDataReader.NextResult again before resultSet is assgined not null;
[16 Oct 2019 7:47] ybb huang
stack

Attachment: callstack.png (image/png, text), 100.63 KiB.

[16 Oct 2019 7:52] ybb huang
number of columns

Attachment: numCols.png (image/png, text), 37.51 KiB.

[16 Oct 2019 8:18] ybb huang
problem description

Attachment: stack explain.jpg (image/jpeg, text), 57.38 KiB.

[16 Oct 2019 8:19] ybb huang
suggestion

Attachment: suggestion.png (image/png, text), 417.66 KiB.

[5 May 2020 13:38] MySQL Verification Team
Thank you for the bug report. Please provide a repeatable test unit.
[6 Jun 2020 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".