Skip to content

v2023-06-18

Compare
Choose a tag to compare
@Viir Viir released this 18 Jun 13:27
· 892 commits to main since this release
Fix bug causing sporadic failures to handle admin HTTP requests

Fix awaiting the processing of the HTTP request before returning control to the ASP.net framework.
This bug affected 'deploy' requests more often than others, probably because of the larger payload HTTP request body size in these cases.
In the previous version, logs from docker had shown related runtime exceptions like the following:
----
fail: ElmTime.Platform.WebService.StartupAdminInterface[0]
      Unobserved task exception in sender System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[System.Threading.Tasks.VoidTaskResult,ElmTime.Platform.WebService.StartupAdminInterface+<>c__DisplayClass34_3+<<Configure>b__20>d]
      System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Cannot access a disposed object.
      Object name: 'HttpRequestStream'.)
       ---> System.ObjectDisposedException: Cannot access a disposed object.
      Object name: 'HttpRequestStream'.
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpRequestPipeReader.<ValidateState>g__ThrowObjectDisposedException|14_0()
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpRequestStream.ReadAsyncInternal(Memory`1 destination, CancellationToken cancellationToken)
         at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
         at Microsoft.AspNetCore.WebUtilities.FileBufferingReadStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
         at Microsoft.AspNetCore.WebUtilities.FileBufferingReadStream.<>c__DisplayClass46_0.<<CopyToAsync>g__CopyToAsyncImpl|0>d.MoveNext()
      --- End of stack trace from previous location ---
         at ElmTime.Platform.WebService.Asp.CopyRequestBody(HttpRequest httpRequest) in /app/elm-time/Platform/WebService/Asp.cs:line 104
         at ElmTime.Platform.WebService.StartupAdminInterface.<>c__DisplayClass34_3.<<Configure>g__deployElmApp|13>d.MoveNext() in /app/elm-time/Platform/WebService/StartupAdminInterface.cs:line 337
      --- End of stack trace from previous location ---
         at ElmTime.Platform.WebService.StartupAdminInterface.<>c__DisplayClass34_3.<<Configure>b__20>d.MoveNext() in /app/elm-time/Platform/WebService/StartupAdminInterface.cs:line 548
         --- End of inner exception stack trace ---