Azure / azure-data-lake-store-net

Azure Data Lake Store .Net SDK
MIT License
18 stars 24 forks source link

CONCURRENTAPPEND failed with Unknown Error: Only one usage of each socket address (protocol/network address/port) is normally permitted #26

Closed manums closed 5 years ago

manums commented 5 years ago

We are facing issues in our container app running on .NET core. I don't know whether it is relevant, but I have set DefaultConnectionLimit to 200. This has started happening from a week or so. It is not even intermittent. We try write to different files using same ADLSClient instance in parallel.

await Connection.ADLSClient .ConcurrentAppendAsync(filePath, true, textByteArray, 0, textByteArray.Length) .ConfigureAwait(false)

It is not that every calls fails but more than some 30% calls are failing due to below exception. I even updated Microsoft.Azure.DataLake.Store to 1.1.11 version.

Exception and stack:

Failed to push data to sink with exception Microsoft.Azure.DataLake.Store.AdlsException: 
Error in concurrent append for file **filename**.

Operation: CONCURRENTAPPEND failed with   Unknown Error: 
Only one usage of each socket address (protocol/network address/port) is normally permitted Only one usage of each socket address (protocol/network address/port) is normally permitted 
Source: System.Net.Requests StackTrace:    at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

at System.Net.WebRequest.<>c.<GetResponseAsync>b__68_2(IAsyncResult iar)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---

at Microsoft.Azure.DataLake.Store.WebTransport.MakeSingleCallAsync(String opCode, String path, ByteBuffer requestData, ByteBuffer responseData, QueryParams qp, AdlsClient client, RequestOptions req, OperationResponse resp, CancellationToken cancelToken, IDictionary`2 customHeaders).
Last encountered exception thrown after 1 tries. [Only one usage of each socket address (protocol/network address/port) is normally permitted Only one usage of each socket address (protocol/network address/port) is normally permitted]
[ServerRequestId:]
 at Microsoft.Azure.DataLake.Store.AdlsClient.ConcurrentAppendAsync(String path, Boolean autoCreate, Byte[] dataBytes, Int32 offset, Int32 length, CancellationToken cancelToken)
rahuldutta90 commented 5 years ago

@manums I think this is because immplementation of HttpWebRequest (which is what we use in our sdk) in netcore. I am already working on moving to HttpClient. We have a pr out internally, currently we are trying to performance measurements. Moving to httpclient will have one instance of httpclient per client which is not possible for httpwebrequest.

manums commented 5 years ago

Is there any estimated date for new nuget publish? In our scenarios, we have some 30-40 tasks call this method which calls ConcurrentAppendAsync in parallel. But all these tasks write into different files. I hope your tests cover this scenario.

I'm falling back retry mechanism for ConcurrentAppendAsync as of now. Suggest if you think there are any alternatives.

rahuldutta90 commented 5 years ago

I am assuming running this on net452 framework is not an option right?

IS using a private nuget package option, till we officially release the package?

manums commented 5 years ago

@rahuldutta90 All our services are on .net core running as docker containers on service fabric. We see connectivity issues even if I make synchronous. We can discuss options about private nuget over email.

rahuldutta90 commented 5 years ago

Released 1.2.0-alpha that uses httpclient. That should mitigate this issue.

andreibarsa commented 4 years ago

Hi,

Do you have any release date for 1.1.2 version? Or an estimation when it will be released?

I have a azure function that is used to create and update files in ADLS. When using version 1.1.20 of the library and performing multiple parallel operations I receive this error message:

CREATE failed with Unknown Error: Only one usage of each socket address (protocol/network address/port) is normally permitted Only one usage of each socket address (protocol/network address/port) is normally permitted Source: System.Net.Requests StackTrace: at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.WebRequest.<>c.<GetResponseAsync>b__68_2(IAsyncResult iar) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)

rahuldutta90 commented 4 years ago

@andreibarsa 1.2.x-alpha is the one you should use for net core. I think the current released version in it is 1.2.3-alpha

andreibarsa commented 4 years ago

It is just an alpha, we need something to use in production. When do you estimate a release?