orleans icon indicating copy to clipboard operation
orleans copied to clipboard

Legacy UseConfiguration doesn't properly set DynamoDBReminderStorageOptions

Open berdon opened this issue 8 years ago • 3 comments

Upgrading from 2.0.0-beta3 I've observed:

Orleans.Runtime.OrleansLifecycleCanceledException: 'Lifecycle start canceled due to errors at stage 20000'

InnerException | {System.ArgumentNullException: Value cannot be null. Parameter name: service at Orleans.Reminders.DynamoDB.DynamoDBStorage..ctor(ILoggerFactory loggerFactory, String service, String accessKey, String secretKey, Int32 readCapacityUnits, Int32 writeCapacityUnits) at Orleans.Reminders.DynamoDB.DynamoDBReminderTable.Init() at Orleans.Runtime.ReminderService.LocalReminderService.d__16.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Orleans.Runtime.Scheduler.AsyncClosureWorkItem.d__8.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Orleans.OrleansTaskExtentions.d__16.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Orleans.Runtime.Silo.<g__StartReminderService73_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Orleans.Runtime.Silo.d__69.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Orleans.Runtime.Silo.d__73.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Orleans.Runtime.SiloLifecycleSubject.MonitoredObserver.d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Orleans.LifecycleSubject.d__8.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Orleans.LifecycleSubject.d__4.MoveNext()} | System.Exception {System.ArgumentNullException}

This seems to be caused by the DynamoDBReminderStorageOptions object not properly being configured when using the legacy extension method UseConfiguration. DynamoDBClusteringOptions does get properly set however.

After manually setting these fields via UseDynamoDBReminderService() everything works:

DynamoDBClusteringOptions clusteringOptions = null;
var siloBuilder = new SiloHostBuilder()
    .ConfigureApplicationParts(appParts =>
    {
        appParts.AddFromApplicationBaseDirectory().WithReferences();
        appParts.AddFromAppDomain().WithReferences();
    })
    .UseConfiguration(config)
    .UseDynamoDBClustering((DynamoDBClusteringOptions options) =>
    {
        // We don't need to do configuring in here because the legacy
        // .UseConfiguration still handles it for us (for now)
        clusteringOptions = options;
    })
    .UseDynamoDBReminderService((DynamoDBReminderStorageOptions options) =>
    {
        // Unfortunately, there's seems to be a a bug in Orleans that doesn't
        // propagate the same clustering options to the reminder storage options
        options.Service = clusteringOptions.Service;
        options.AccessKey = clusteringOptions.AccessKey;
        options.SecretKey = clusteringOptions.SecretKey;
    });

berdon avatar Jun 06 '18 14:06 berdon

Hi unfortunately, legacy configuration on storage provider isn't supported anymore in 2.0. To configure a grain storage, one need to use the new way to configure through options. Sorry for the confusion, and thanks for reporting to us. But this is expected behavior.

xiazen avatar Jun 06 '18 18:06 xiazen

feel free to leave further concerns or comments regarding this breaking change. And we can see what we can do about it.

xiazen avatar Jun 06 '18 18:06 xiazen

@JillHeaden there's a small task here for you :) . we need documentation on our 2.0 docs, stating configuring storage providers through legacy configuration classes are not supported in 2.0.

xiazen avatar Jun 26 '18 19:06 xiazen