Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible incompatibility with .NET 5.0 #165

Closed
jsquire opened this issue Aug 13, 2020 · 4 comments
Closed

Possible incompatibility with .NET 5.0 #165

jsquire opened this issue Aug 13, 2020 · 4 comments

Comments

@jsquire
Copy link
Member

jsquire commented Aug 13, 2020

Summary

The Azure client libraries for Service Bus and Event Hubs have seen some reported issues of an exception trigged within the AMQP library when running on the .NET 5.0-preview.7 platform. As .NET 5 is still in preview, I'm unsure of whether this is a temporary regression within the host framework or a sign that there's a breaking change that impacts Microsoft.Azure.Amqp.

My goal in opening this issue is to raise awareness and, hopefully, a quick investigation.

Details

The exception seems to be consistent between the two Azure SDKs and triggered when an AMQP link is being opened to the service.

Message:
Operation is not valid due to the current state of the object

Example Stacktraces:

System.InvalidOperationException
  HResult=0x80131509
  Message=Operation is not valid due to the current state of the object.
  Source=Microsoft.Azure.Amqp
  StackTrace:
   at Microsoft.Azure.Amqp.Transport.TransportStream.Flush()
   at System.IO.Stream.<>c.<FlushAsync>b__39_0(Object state) in /_/src/libraries/System.Private.CoreLib/src/System/IO/Stream.cs:line 239
   at System.Threading.Tasks.Task.InnerInvoke() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2381
   at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object obj) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2360
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 289
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/ExceptionServices/ExceptionDispatchInfo.cs:line 57

  This exception was originally thrown at this call stack:
    Microsoft.Azure.Amqp.Transport.TransportStream.Flush()
    System.IO.Stream.FlushAsync.AnonymousMethod__39_0(object) in Stream.cs
    System.Threading.Tasks.Task.InnerInvoke() in Task.cs
    System.Threading.Tasks.Task..cctor.AnonymousMethod__277_0(object) in Task.cs
    System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, object) in ExecutionContext.cs
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in ExceptionDispatchInfo.cs
at Microsoft.Azure.Amqp.Transport.TransportStream.Flush() at System.IO.Stream.<>c.<FlushAsync>b__39_0(Object state)
at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object obj) 
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) 
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult() 
at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__169`1.MoveNext() 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() 
at Microsoft.Azure.Amqp.TaskHelpers.EndAsyncResult(IAsyncResult asyncResult) 
at Microsoft.Azure.Amqp.StreamExtensions.EndAuthenticateAsClient(SslStream sslStream, IAsyncResult asyncResult) 
at Microsoft.Azure.Amqp.Transport.TlsTransport.HandleOpenComplete(IAsyncResult result, Boolean syncComplete) 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at Microsoft.Azure.Amqp.ExceptionDispatcher.Throw(Exception exception) 
at Microsoft.Azure.Amqp.AsyncResult.End[TAsyncResult](IAsyncResult result) 
at Microsoft.Azure.Amqp.AmqpObject.OpenAsyncResult.End(IAsyncResult result) 
at Microsoft.Azure.Amqp.AmqpObject.EndOpen(IAsyncResult result) 
at Microsoft.Azure.Amqp.Transport.TlsTransportInitiator.HandleTransportOpened(IAsyncResult result) 
at Microsoft.Azure.Amqp.Transport.TlsTransportInitiator.OnTransportOpened(IAsyncResult result) 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() 
at Azure.Messaging.EventHubs.Amqp.AmqpConnectionScope.<CreateAndOpenConnectionAsync>d__60.MoveNext() 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() 
at Microsoft.Azure.Amqp.FaultTolerantAmqpObject`1.<OnCreateAsync>d__6.MoveNext() 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at Microsoft.Azure.Amqp.Singleton`1.<GetOrCreateAsync>d__13.MoveNext() 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at Microsoft.Azure.Amqp.Singleton`1.<GetOrCreateAsync>d__13.MoveNext() 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() 
at Azure.Messaging.EventHubs.Amqp.AmqpConnectionScope.<OpenProducerLinkAsync>d__58.MoveNext() 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() 
at Azure.Messaging.EventHubs.Amqp.AmqpProducer.<CreateLinkAndEnsureProducerStateAsync>d__32.MoveNext() 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at Azure.Messaging.EventHubs.Amqp.AmqpProducer.<CreateLinkAndEnsureProducerStateAsync>d__32.MoveNext() 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.Azure.Amqp.FaultTolerantAmqpObject`1.<OnCreateAsync>d__6.MoveNext()\r\n 

Related Issues:

@jsquire
Copy link
Member Author

jsquire commented Aug 13, 2020

//fyi: @sjkwak, @xinchen10

@jsquire
Copy link
Member Author

jsquire commented Aug 13, 2020

//cc: @JoshLove-msft, @MiYanni, @ramya-rao-a

@ramya-rao-a
Copy link

cc @shankarsama, @axisc

xinchen10 added a commit that referenced this issue Aug 17, 2020
The SslStream starts calling the inner stream's Flush method in some cases. Removed the exception since everything has been sent to the transport already.
@frankbuckley
Copy link

Are there plans to release a fixed package soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants