You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AmqpObject.State currently is a property on the object which is used to to implement methods like IsClosed(). Unless these are thread safe, they might not return the latest value. One of volatile/interlocked/lock should be used for this property.
Similar to Azure/azure-service-bus-dotnet#297
Sample code where this becomes an issue:
while(timeoutHelper.RemainingTime()>TimeSpan.Zero){IEnumerable<AmqpMessage>amqpMessages=null;varhasMessages=awaitTask.Factory.FromAsync((c,s)=>receiveLink.BeginReceiveRemoteMessages(maxMessageCount,DefaultBatchFlushInterval,timeoutHelper.RemainingTime(),c,s),
a =>receiveLink.EndReceiveMessages(a,outamqpMessages),this).ConfigureAwait(false);Exceptionexception;if((exception=receiveLink.GetInnerException())!=null){throwexception;}if(receiveLink.IsClosing()){break;}}
In the above case, receiveLink.IsClosing() will not return true if the link (through linkManager) is closed on a different thread.
The text was updated successfully, but these errors were encountered:
AmqpObject.State
currently is a property on the object which is used to to implement methods likeIsClosed()
. Unless these are thread safe, they might not return the latest value. One ofvolatile
/interlocked
/lock
should be used for this property.Similar to Azure/azure-service-bus-dotnet#297
Sample code where this becomes an issue:
In the above case, receiveLink.IsClosing() will not return true if the link (through linkManager) is closed on a different thread.
The text was updated successfully, but these errors were encountered: