3

I have a very simply query in my projects that returns ~1.3 million rows:

var aliases = ctx.Query<sec_entity_alias>(@"select * from sec_entity_alias");

The class that is mapped to is:

    public partial class sec_entity_alias
{
    public int id { get; set; }
    public int sec_entity_id { get; set; }
    public byte sec_entity_alias_type_id { get; set; }
    public string symbol { get; set; }

    public virtual sec_entity_alias_type sec_entity_alias_type { get; set; }
}

When I run the query it hangs indefinitely and pegs the CPU. When I remove the dapper type mapping and instead run the following, the query returns all rows in ~200ms

var aliases = ctx.Query(@"select * from sec_entity_alias");

This issue suddenly started appearing today after I upgraded to Windows 10 from Windows 8.1

Has anyone else noticed this issue or am I missing something apparent here?

EDIT:

I just ran the same code on a Windows'12 R2 server and it ran completely fine.

Below is a profiling session where spends the most time on the Windows 10 machine.

Another interesting tidbit: when I create a new project and only query the sec_entity_alias table it works fine but in my main project where I load some other tables first is where it encounters the issue.

enter image description here

TJF
  • 2,248
  • 4
  • 28
  • 43
  • Interesting stuff !!! – vendettamit Jul 31 '15 at 01:36
  • That is interesting and alarming. I haven't updated my workstation to win 10 yet, but: I am intrigued! I am not aware of any reason why this might be the case. – Marc Gravell Jul 31 '15 at 19:37
  • It seems to become a problem at around 500k records - when I reduce the records to 400k the query is fast and when I have 500k records it hangs indefinitely. – TJF Jul 31 '15 at 21:13
  • @MarcGravell I am having the exact same issue with Dapper, queries hanging indefinitely. In my case it is on both Windows 7 and Windows Server 2012, so not related to the OS. It has happened maybe 5 times since I switched from NPoco to Dapper, using the same queries. Although I can't pinpoint it exactly, it also seems to occur on queries with a huge number of returned results. I have also seen this even older post which mentions a similar case: http://stackoverflow.com/questions/27029951/dapper-hangs-at-execute – Xavier Peña Oct 12 '16 at 14:17
  • @MarcGravell: It does not seem to concern large queries only. The only one I've caught while debugging was a query that returns 424 rows. After hanging indefinitely and re-executing, the issue does not appear again. The execution was: `return _db.Query(sqlString).ToList();`. The logs show the following data: from the all 311 executions (hour by hour) of my process, 4 failed because of this error (30min timeout instead of average 5 second execution). 3 of those failures where during the last 24h. – Xavier Peña Oct 12 '16 at 14:38
  • @XavierPeña this is ... odd; sounds like some kind of nasty deadlock case; are you using the sync API or the async API? (just to give me a foot in) – Marc Gravell Oct 12 '16 at 14:39
  • @MarcGravell I am using the sync API: ``. I will try to find more hints that might help track this problem, I'll post them here right away if there were any. – Xavier Peña Oct 12 '16 at 14:48
  • @MarcGravell I am trying to track it down with the following strategy: [post](http://stackoverflow.com/q/40017402/831138). Two more timeouts occurred during the night. It is also worth noting that I am using `MySql.Data` as a connector. – Xavier Peña Oct 13 '16 at 09:47
  • fyi, I was able to resolve this with setting "buffered:false" in the query – TJF Oct 17 '16 at 13:25

0 Answers0