Azure / azure-storage-net

Microsoft Azure Storage Libraries for .NET
Apache License 2.0
446 stars 373 forks source link

AzureBlobTraceListener ThreadAbortException #883

Open schmidtaa opened 5 years ago

schmidtaa commented 5 years ago

Describe the bug

We're getting the following error when entries in the blob are generated. It is sporadic and seems like may be correlated with higher load.

Exception or Stack Trace

2019-04-10T13:04:41 System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.AppendStreamToBlob(Stream stream) at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.ConsumeBuffer()

2019-04-10T13:04:41 System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.ConsumeBuffer() at Microsoft.WindowsAzure.WebSites.Diagnostics.BaseTraceListener.FlushBuffer(Boolean waitForCompletion)

2019-04-10T13:04:41 System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.WindowsAzure.WebSites.Diagnostics.BaseTraceListener.FlushBuffer(Boolean waitForCompletion) at Microsoft.WindowsAzure.WebSites.Diagnostics.BaseTraceListener.OnFlushBuffer(Object state)

2019-04-10T19:04:18 System.Threading.ThreadAbortException: Thread was being aborted. at System.Xml.XmlUtf8RawTextWriter..ctor(Stream stream, XmlWriterSettings settings) at System.Xml.XmlWriterSettings.CreateWriter(Stream output) at Microsoft.WindowsAzure.Storage.Blob.Protocol.BlobRequest.WriteBlockListBody(IEnumerable1 blocks, Stream outputStream) at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.PutBlockListImpl(IEnumerable1 blocks, AccessCondition accessCondition, BlobRequestOptions options) at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.PutBlockList(IEnumerable`1 blockList, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext) at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.AppendStreamToBlob(Stream stream) at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.ConsumeBuffer()

2019-04-10T19:04:18 System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.ConsumeBuffer() at Microsoft.WindowsAzure.WebSites.Diagnostics.BaseTraceListener.FlushBuffer(Boolean waitForCompletion)

2019-04-10T19:04:18 System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.WindowsAzure.WebSites.Diagnostics.BaseTraceListener.FlushBuffer(Boolean waitForCompletion) at Microsoft.WindowsAzure.WebSites.Diagnostics.BaseTraceListener.OnFlushBuffer(Object state)

2019-04-19T22:53:39 Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (400) Bad Request. ---> System.Net.WebException: The remote server returned an error: (400) Bad Request. at System.Net.HttpWebRequest.GetResponse() at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand1 cmd, IRetryPolicy policy, OperationContext operationContext) --- End of inner exception stack trace --- at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand1 cmd, IRetryPolicy policy, OperationContext operationContext) at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.AppendStreamToBlob(Stream stream) at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.ConsumeBuffer() Request Information RequestID:a912f750-c01e-011a-3302-f7a557000000 RequestDate:Fri, 19 Apr 2019 22:53:38 GMT StatusMessage:The specified block list is invalid. ErrorCode:InvalidBlockList

2019-04-19T22:43:49 System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.AppendStreamToBlob(Stream stream) at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.ConsumeBuffer()

2019-04-19T22:43:49 System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.ConsumeBuffer() at Microsoft.WindowsAzure.WebSites.Diagnostics.BaseTraceListener.FlushBuffer(Boolean waitForCompletion)

2019-04-19T22:43:49 System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.WindowsAzure.WebSites.Diagnostics.BaseTraceListener.FlushBuffer(Boolean waitForCompletion) at Microsoft.WindowsAzure.WebSites.Diagnostics.BaseTraceListener.OnFlushBuffer(Object state)

To Reproduce

Create blob in the Azure Create snippet to log entries via log4net to the blob using AzureBlobTraceListener Code Snippet

Logger.Info or Logger.Error or Logger.Warn causes this.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Setup (please complete the following information): 4.7.3324.0 built by: NET472REL1LAST_C

Additional context Add any other context about the problem here.

seanmcc-msft commented 5 years ago

What version of the SDK are you using? And what APIs are you calling that are resulting in these exceptions?

schmidtaa commented 5 years ago

We're using log4net to log info messages and getting exceptions when we call methods: logger.Info(…) or logger.Warn(…) or logger.Error(…):

SDK or .Net which is running in app service : 4.7.3062.0 built by: NET472REL1

Sincerely, Alexander Schmidt, MCPD EA

--------- Original Message --------- Subject: Re: [Azure/azure-storage-net] AzureBlobTraceListener ThreadAbortException (#883) From: "Sean McCullough" notifications@github.com Date: 5/3/19 2:16 pm To: "Azure/azure-storage-net" azure-storage-net@noreply.github.com Cc: "schmidtaa" me@alexschmidt.net, "Author" author@noreply.github.com

What version of the SDK are you using? And what APIs are you calling that are resulting in these exceptions?

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

schmidtaa commented 5 years ago

Any updates on this issue? Any workaround team would recommend?