Comments (5)
Some more logging output (Shows that the options are set properly:
silo-1 | 05.03.24 15:42:26.609 [INF] Configuration Orleans.Configuration.EndpointOptions:
silo-1 | AdvertisedIPAddress: 192.168.201.36
silo-1 | SiloPort: 11111
silo-1 | GatewayPort: 30000
silo-1 | SiloListeningEndpoint: 0.0.0.0:11111
silo-1 | GatewayListeningEndpoint: 0.0.0.0:30000
from orleans.
The server has the following configuration options (Should be ok as well, I guess)
{
"SiloIpAddress": "192.168.201.36",
"GatewayPort": 30000
}
from orleans.
Something more to mention: We use a background service that implements BackgroundService
from Microsoft.Extensions.Hosting
. In there, we create a Orleans client. The client is needed to perform some checks on Silo startup. The client runs "locally" in the Silo itself and seems to be causing the issue...
private async Task<IClusterClient> CreateLocalOrleansClient()
{
var siloIpAddress = this.advertisedSiloIp;
if (Program.InCompose)
{
siloIpAddress = IPAddress.Any;
}
this.logger.Information("Initializing OrleansRpc client for silo ip {IpAddress}...", siloIpAddress);
var orleansClient = new ClientBuilder().Configure<ClusterOptions>(
options =>
{
options.ClusterId = this.configuration.ClusterId;
options.ServiceId = this.configuration.ServiceId;
})
.UseStaticClustering(new IPEndPoint(siloIpAddress, this.configuration.GatewayPort))
.ConfigureApplicationParts(
parts =>
{
parts.AddApplicationPart(typeof(ISomethingGrain).Assembly).WithReferences();
})
.ConfigureLogging(l => l.AddSerilog())
.AddSimpleMessageStreamProvider(StreamGlobals.SmsProvider)
.Build();
await orleansClient.Connect();
return orleansClient;
}
from orleans.
Something more to mention: We use a background service that implements
BackgroundService
fromMicrosoft.Extensions.Hosting
. In there, we create a Orleans client. The client is needed to perform some checks on Silo startup. The client runs "locally" in the Silo itself and seems to be causing the issue...private async Task<IClusterClient> CreateLocalOrleansClient() { var siloIpAddress = this.advertisedSiloIp; if (Program.InCompose) { siloIpAddress = IPAddress.Any; } this.logger.Information("Initializing OrleansRpc client for silo ip {IpAddress}...", siloIpAddress); var orleansClient = new ClientBuilder().Configure<ClusterOptions>( options => { options.ClusterId = this.configuration.ClusterId; options.ServiceId = this.configuration.ServiceId; }) .UseStaticClustering(new IPEndPoint(siloIpAddress, this.configuration.GatewayPort)) .ConfigureApplicationParts( parts => { parts.AddApplicationPart(typeof(ISomethingGrain).Assembly).WithReferences(); }) .ConfigureLogging(l => l.AddSerilog()) .AddSimpleMessageStreamProvider(StreamGlobals.SmsProvider) .Build(); await orleansClient.Connect(); return orleansClient; }
I have reworked this now following https://learn.microsoft.com/en-us/dotnet/orleans/host/client?pivots=orleans-3-x.
The IClusterClient
is now injected per DI, the issue persists, however...
from orleans.
Again an update: The issue persists, but the server project now causes the issue, the Silo itself can be started properly...
The client in the server project is initialized like this:
var gateways = this.configuration.OrleansSiloEndPoints; // This is just 192.168.201.36, port 30000 from the configuration.
// It's loaded properly, I check that. --> It's irrelevant as well as the gatewys are overwritten below with the environment variable.
if (Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_COMPOSE")?.ToLowerInvariant() == "true")
{
var addresses = Dns.GetHostAddresses("server");
gateways = addresses.Select(a => new IPEndPoint(a, 30000)).ToArray();
}
var client = new ClientBuilder()
.Configure<ClusterOptions>(
options =>
{
options.ClusterId = this.configuration.ClusterId;
options.ServiceId = this.configuration.ServiceId;
})
.Configure<ClientMessagingOptions>(opts =>
{
opts.ResponseTimeout = TimeSpan.FromSeconds(90);
})
.Configure<MessagingOptions>(opts =>
{
opts.ResponseTimeout = TimeSpan.FromSeconds(90);
})
.UseStaticClustering(gateways)
.ConfigureApplicationParts(parts =>
{
parts.AddApplicationPart(typeof(ISomethingGrain).Assembly).WithReferences();
})
.ConfigureLogging(logging => logging.AddSerilog())
.Configure<ClientMessagingOptions>(options => options.MaxMessageBodySize = 134217728) //128 MB
.AddSimpleMessageStreamProvider("SmsProvider")
.Build();
from orleans.
Related Issues (20)
- Calls to grains never complete on cluster change HOT 1
- Serialization issues - Orleans 8.0.0 HOT 4
- [Clustering] Support cleaning up abandoned ClusterIds
- Orleans Streaming: in [SetCursor] method, If last purged token does not exists, do not throw an exception, just start from the oldest message in cache HOT 2
- Function Suggestion: RedisGrainStorage
- After upgrading Orleans8. x, Reminder cannot reliably trigger ReceiveReminder() HOT 9
- `orleans-grains` counter gets incremented multiple times by stateless worker grains
- Running Orleans via project references for debugging HOT 3
- Proposal: Support TTL for purging grain state for inactive grains HOT 1
- Orleans 7.x does not support multiple stateless worker grain types with different `StatelessWorkerPlacement.MaxLocal` values HOT 1
- One Way time Duration. Is it too long? HOT 2
- Implementing Oneway Grain to Grain Media Streaming with Different Nodes and Silos in the Same Cluster
- New Microsoft.Extensions.Configuration stuff breaks existing Orleans project with "Could not find Clustering provider named 'Default'." HOT 5
- Failing DeepCopy when implementing multiple IConverter<,> on single class
- Mark explicitly removed or obsolete ids are reserved
- Azure App Service fails to start with never ending Orleans connection exceptions HOT 3
- ISiloBuilder.ConfigureApplicationParts not in version 8 ? HOT 7
- How do I correctly call the DeactivateOnIdle() method within the Grain? Getting error! HOT 2
- The best suggestion for grain state storage? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orleans.