Bug #97248 .Net Driver consume huge memory when connection timeout
Submitted: 16 Oct 2019 7:46
Reporter: ybb huang Email Updates:
Status: Open 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.