Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source code in Orleans Typical configurations article won't compile and is also outdated #38430

Closed
DmitryGolubenkov opened this issue Nov 25, 2023 · 0 comments · Fixed by #41654
Assignees
Labels
doc-bug Problem with the content; needs to be fixed [org][type][category] dotnet-orleans/svc okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. Pri2 📌 seQUESTered Identifies that an issue has been imported into Quest.

Comments

@DmitryGolubenkov
Copy link

DmitryGolubenkov commented Nov 25, 2023

Type of issue

Outdated article

Description

Incorrect and outdated things

I''ll write all examples based on Reliable production deployment using SQL Server, but this issue also applies to the rest of the article.

const string connectionString = "YOUR_CONNECTION_STRING_HERE";
var silo = new HostBuilder()
    .UseOrleans(builder =>
    {
        .Configure<ClusterOptions>(options =>
        {
            options.ClusterId = "Cluster42";
            options.ServiceId = "MyAwesomeService";
        })
        .UseAdoNetClustering(options =>
        {
          options.ConnectionString = connectionString;
          options.Invariant = "System.Data.SqlClient";
        })
        .ConfigureEndpoints(siloPort: 11111, gatewayPort: 30000)
        .ConfigureLogging(builder => builder.SetMinimumLevel(LogLevel.Warning).AddConsole())
    })
    .Build();
  1. builder needs to be written before .Configure for this source code to be correct.
var silo = new HostBuilder()
    .UseOrleans(builder =>
    {
        builder.Configure<ClusterOptions>(options =>
        {
...
  1. Client configuration is outdated. This commit changed a lot of things inside ClientBuilder, and in this case - the constructor: dotnet/orleans@b47a522#diff-104db009ab6cd8389ff4dc65fe1bb05e6888b4af07d2010b938dd5c1fe61c2c5

Actual:

const string connectionString = "YOUR_CONNECTION_STRING_HERE";
var client = new ClientBuilder()
    .Configure<ClusterOptions>(options =>
    {

Expected:

const string connectionString = "YOUR_CONNECTION_STRING_HERE";
var client = new ClientBuilder(builder.Services)
    .Configure<ClusterOptions>(options =>
    {
  1. Also client configuration:
    .ConfigureLogging(builder => builder.SetMinimumLevel(LogLevel.Warning).AddConsole())
    .Build();

Build doesn't exist anymore. Also I can't find if ConfigureLogging exists anywhere. There is SiloBuilderExtensions.ConfigureLogging extension method, but no such method for ClientBuilder.

image

Page URL

https://learn.microsoft.com/en-us/dotnet/orleans/host/configuration-guide/startup-tasks

Content source URL

https://github.com/dotnet/docs/blob/main/docs/orleans/host/configuration-guide/startup-tasks.md

Document Version Independent Id

f019de50-1779-55b5-63b3-c422294b2f02

Article author

IEvangelist

Metadata

  • ID: 6c9de6c1-47ed-c1b7-7a85-51c4e3770dac
  • Product: dotnet-orleans

Associated WorkItem - 281890

@IEvangelist IEvangelist self-assigned this Jul 9, 2024
@IEvangelist IEvangelist added doc-bug Problem with the content; needs to be fixed [org][type][category] 🗺️ reQUEST Triggers an issue to be imported into Quest. labels Jul 9, 2024
@dotnet-bot dotnet-bot removed ⌚ Not Triaged Not triaged labels Jul 9, 2024
IEvangelist added a commit to IEvangelist/docs that referenced this issue Jul 9, 2024
@dotnet-policy-service dotnet-policy-service bot added the okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. label Jul 9, 2024
@sequestor sequestor bot added 📌 seQUESTered Identifies that an issue has been imported into Quest. and removed 🗺️ reQUEST Triggers an issue to be imported into Quest. labels Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-bug Problem with the content; needs to be fixed [org][type][category] dotnet-orleans/svc okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. Pri2 📌 seQUESTered Identifies that an issue has been imported into Quest.
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants