GetScatter / eos-sharp

C# client library for EOS blockchains
MIT License
75 stars 48 forks source link

HttpHelper class stuck? #14

Closed aiqinxuancai closed 5 years ago

aiqinxuancai commented 5 years ago

I use a 50 thread loop queue to perform "get_block" , total of 100,000 blocks, and finally there will always be 1-3 threads in the "runing" state can not exit.

I found that the code for these threads is running to line 115 of the HttpHelper.cs: return JsonSerializer.Create(jsonSettings).Deserialize(jtr);

image

mmcs85 commented 5 years ago

I don't see a reason for that to get stuck unless the block has a lot of information and so It takes time to deserialize.

Created a unit test for this:

https://github.com/GetScatter/eos-sharp/blob/master/EosSharp/EosSharp.UnitTests/StressUnitTests.cs#L31

Give it a try. So far fetching 1000 blocks with 50 threads runs very fast, 5 seconds to finish for me.

If you want to check the network you can enable fiddler proxy here:

https://github.com/GetScatter/eos-sharp/blob/master/EosSharp/EosSharp.UnitTests/app.config#L6

mmcs85 commented 5 years ago

You can reopen if you find more information about this issue.