[3507] An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full

461 views
Skip to first unread message

Arno den Uijl

unread,
Nov 10, 2014, 4:35:30 AM11/10/14
to rav...@googlegroups.com
When opening a massive amount of sessions from the .net client I get a socketexception in 3507. In de stable 2.5 release this doesn't happen.
One could argue you shouldn't open as many sessions, but since 2.5 doesn't break i would expect 3.0 wouldn't either. 

The exception:

Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalBind(EndPoint localEP)
   at System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP, Boolean flowContext, AsyncCallback callback, Object state)
   at System.Net.Sockets.Socket.UnsafeBeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state,
IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
   at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)


Code to reproduce:

using System;
using System.Threading.Tasks;
using Raven.Client.Document;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
                var store = new DocumentStore {Url = "http://localhost:8080", DefaultDatabase = "test"}.Initialize();
                Parallel.For(0, 100000, new ParallelOptions() {MaxDegreeOfParallelism = Environment.ProcessorCount}, i =>
                {
                    using (var ses = store.OpenSession())
                    {
                        ses.Store(new
                        {
                            Id = "test/" + i,
                            Naam = "Name"
                        });
                        ses.SaveChanges();
                        var a = ses.Load<dynamic>("test/" + i);
                    }
                });           
        }
    }
}

Oren Eini (Ayende Rahien)

unread,
Nov 10, 2014, 7:08:34 AM11/10/14
to ravendb

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages