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)
{
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);
}
});
}
}
}