planetarium / libplanet

Blockchain in C#/.NET for on-chain, decentralized gaming
https://docs.libplanet.io/
GNU Lesser General Public License v2.1
506 stars 142 forks source link

Socket files are not closed #261

Closed earlbread closed 4 years ago

earlbread commented 5 years ago

It occurs the error below:

5/24/2019 5:02:16 AM +00:00: An unexpected exception occured. try again...
    System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. ---> System.Net.Sockets.SocketException: Connection reset by peer
      at System.Net.Sockets.Socket.EndReceive (System.IAsyncResult asyncResult) [0x00012] in <c9226b2f33b7421e85bb391f94075e49>:0
      at System.Net.Sockets.NetworkStream.EndRead (System.IAsyncResult asyncResult) [0x00057] in <c9226b2f33b7421e85bb391f94075e49>:0
       --- End of inner exception stack trace ---
      at System.Net.Sockets.NetworkStream.EndRead (System.IAsyncResult asyncResult) [0x0009b] in <c9226b2f33b7421e85bb391f94075e49>:0
      at System.IO.Stream+<>c.<BeginEndReadAsync>b__43_1 (System.IO.Stream stream, System.IAsyncResult asyncResult) [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.Threading.Tasks.TaskFactory`1+FromAsyncTrimPromise`1[TResult,TInstance].Complete (TInstance thisRef, System.Func`3[T1,T2,TResult] endMethod, System.IAsyncResult asyncResult, System.Boolean requiresSynchronization) [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48
    >:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at Libplanet.Stun.Messages.StunMessage+<Parse>d__20.MoveNext () [0x00083] in <7382fee0696045fb9294b83517824627>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at Libplanet.Stun.TurnClient+<AcceptRelayedStreamAsync>d__26.MoveNext () [0x0018e] in <7382fee0696045fb9294b83517824627>:0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at Libplanet.Net.Swarm+<BindingProxies>d__88.MoveNext () [0x00088] in <c52f70b81883411abda1ad80c0853c38>:0 

    Uploading Crash Report
    IOException: Too many open files
      at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0019e] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean isAsync, System.Boolean anonymous) [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access) [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess)
      at Libplanet.Store.FileStore.IndexFileStream (System.String namespace) [0x00007] in <c52f70b81883411abda1ad80c0853c38>:0
      at Libplanet.Store.FileStore.IndexBlockHash (System.String namespace, System.Int64 index) [0x00037] in <c52f70b81883411abda1ad80c0853c38>:0
      at Libplanet.Blockchain.BlockChain`1[T].get_Item (System.Int64 index) [0x00025] in <c52f70b81883411abda1ad80c0853c38>:0
      at Libplanet.Blockchain.BlockChain`1[T].get_Item (System.Int32 index) [0x00000] in <c52f70b81883411abda1ad80c0853c38>:0
      at Libplanet.Blockchain.Policies.BlockPolicy`1[T].GetNextBlockDifficulty (System.Collections.Generic.IReadOnlyList`1[T] blocks) [0x00032] in <c52f70b81883411abda1ad80c0853c38>:0
      at Libplanet.Blockchain.Policies.BlockPolicy`1[T].ValidateNextBlock (System.Collections.Generic.IReadOnlyList`1[T] blocks, Libplanet.Blocks.Block`1[T] nextBlock) [0x00007] in <c52f70b81883411abda1ad80c0853c38>:0
      at Libplanet.Blockchain.BlockChain`1[T].Append (Libplanet.Blocks.Block`1[T] block, System.DateTimeOffset currentTime, System.Boolean render) [0x0001e] in <c52f70b81883411abda1ad80c0853c38>:0
      at Libplanet.Blockchain.BlockChain`1[T].Append (Libplanet.Blocks.Block`1[T] block, System.DateTimeOffset currentTime) [0x00000] in <c52f70b81883411abda1ad80c0853c38>:0
      at Libplanet.Blockchain.BlockChain`1[T].MineBlock (Libplanet.Address miner, System.DateTimeOffset currentTime) [0x0007d] in <c52f70b81883411abda1ad80c0853c38>:0
      at Libplanet.Blockchain.BlockChain`1[T].MineBlock (Libplanet.Address miner) [0x00007] in <c52f70b81883411abda1ad80c0853c38>:0
      at Nekoyume.Action.Agent+<>c__DisplayClass37_0.<CoMiner>b__0 () [0x0002c] in <65e4db0af9f9489db113d7e93cbae3f1>:0
      at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
      at System.Threading.Tasks.Task.Execute () [0x00010] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
    Rethrow as AggregateException: One or more errors occurred.

    UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    UnityEngine.Logger:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    Nekoyume.Action.<CoMiner>d__37:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

    (Filename: <1f0c1ef1ad524c38bbc5536809c46b48> Line: 0)
moreal commented 4 years ago

@earlbread Is it still a valid issue?

earlbread commented 4 years ago

This is resolved by #414. @moreal