-
Notifications
You must be signed in to change notification settings - Fork 73
Closed
Description
The rider can set the number of assemblies in parallel, when multiple processes get available ports, mong2go get duplicate ports and throw an exception
MongoDB.Driver.MongoCommandException
Command replSetInitiate failed: already initialized.
at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1.ProcessResponse(ConnectionId connectionId, CommandMessage responseMessage)
at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1.Execute(IConnection connection, CancellationToken cancellationToken)
at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.Execute(IConnection connection, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Servers.Server.ServerChannel.ExecuteProtocol[TResult](IWireProtocol`1 protocol, ICoreSession session, CancellationToken cancellationToken)
So, in multi-process, we cannot be sure that the port is available.
public bool IsPortAvailable(int portNumber) |
Use a port number of zero if you want the underlying service provider to assign a free port for you
https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.socket?view=net-5.0#remarks
Metadata
Metadata
Assignees
Labels
No labels