by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:09
    sergeybykov commented #6650
  • 04:07
    sergeybykov closed #6637
  • 04:07
    sergeybykov commented #6637
  • 04:06
    sergeybykov commented #6651
  • 04:06

    sergeybykov on docs

    Added a note about SimpleMessag… (compare)

  • 04:06
    sergeybykov closed #6651
  • 04:05
    sergeybykov assigned #6654
  • 04:03
    sergeybykov commented #6608
  • 03:54
    sergeybykov commented #5781
  • 03:47
    sergeybykov commented #6652
  • 03:45
    sergeybykov demilestoned #6504
  • 03:45
    sergeybykov milestoned #6504
  • 03:44
    sergeybykov milestoned #1121
  • 03:44
    sergeybykov demilestoned #1121
  • 03:44
    sergeybykov commented #1121
  • 03:41
    sergeybykov commented #602
  • 03:40
    sergeybykov commented #6670
  • 03:34
    sergeybykov milestoned #6669
  • 03:34
    sergeybykov assigned #6669
  • 03:33
    sergeybykov commented #6674
Pavel
@pzybenkov_gitlab
sorry, trivial question. It is either set up in UseLocalHostClustering or detected automatically if AdoNet clustering configured
Lars Thomas Denstad
@COCPORN
Great talk, @ReubenBond. I've been out of the loop so long working on other projects I didn't even know about the new persistence interface.
Lars Thomas Denstad
@COCPORN
Sorry, I didn't look at the APIs, but is it possible to "lazy load" the state? That would be tremendously beneficial in a lot of scenarios, and save trips to the DB.
Reuben Bond
@ReubenBond
@COCPORN not yet, but that isn't the first time someone has asked. What should the API look like?
await myState.GetStateAsync();
It would be error prone if you had to check .Value before calling .LoadStateAsync()
Has anyone messed around with running Orleans on Tye yet?
Reuben Bond
@ReubenBond
@ElanHasson I want to implement IAsyncEnumerable in a way that allows high performance via windowing/buffering, and it would require a codegen change to let grain interface methods return an IAsyncEnumerable and work with async generators (yield), etc
Elan Hasson
@ElanHasson
Yeah that's a better solution 🙂
Lars Thomas Denstad
@COCPORN
I am going to chime in at a later point, but I think you can make the API better than I ever could. Just make it so we don't have to be trippin' to the DB to create something, when we know it's new.
wanton7
@wanton7
@ReubenBond DAPR .NET SDK has lazy state system so maybe something similar?
Lars Thomas Denstad
@COCPORN
If you made something like that, you could actually do ingestion with Orleans. (Hush hush).
wanton7
@wanton7
@ReubenBond What I found annoying in DARP .NET SDK when I tried it, there was no way of loading multiple states in parallel. Underlying implementation isn't thread safe (and I don't think it needs to be) so you can't run multiple task simultaneously. If similar API would be used for Orleans I think you should add some multi get state feature to it.
Jan Johansson
@jan-johansson-mr
Going to watch the talk now... :-)
Jan Johansson
@jan-johansson-mr
Hi, one generic question about polymorphic behavior... assume we have a base shared by grain types, with an interface, like BaseGrain and IBaseGrain... using .GetGrain<IBaseGrain>(id) (some id, e.g. guid) makes the runtime throw an exception telling that multiple grains implements BaseGrain and runtime doesn't know what of the grain types to pick (e.g. instantiate)
(I'm thinking out loud while writing this) :-)
now assume that we already have a grain stored, with a concrete type, e.g. Player that's based on BaseGrain, e.g. class Player : BaseGrain, IPlayer with some id (e.g. guid again)
then one thought would be that using this id again, with .GetGrain<IBaseGrain>(id) would be enough to get the proper grain with runtime... maybe
however, this will not work
Jan Johansson
@jan-johansson-mr
we have .GetGrain<T>(id, "class to instantiate") as option though
and it works with that, e.g. .GetGrain<IBaseGrain>(id, "namespace.Player)
Reuben Bond
@ReubenBond
@jan-johansson-mr you need to disambiguate it, so you can use that overload which allows you to specify a class prefix or you can use a separate interface as a marker. It needs to be unambiguous
@wanton7 how does that look? It's more of an API/usability issue than a technical one. If the state was injected as ILazyGrainState<T> for example, then at least it's clear by the type. Alternatively, maybe a separate attribute or a parameter to the attribute could make it more clear. That way, at least it's obvious when debugging user code that they haven't loaded the state. I suppose we could also throw if the user tries to access .Value without first having called LoadStateAsync
wanton7
@wanton7
@ReubenBond ILazyGrainState soundd fine as well could you just have async GetState method that would return ValueTask<T>? It would be great if you could call multiple GetState methods concurrently.
Reuben Bond
@ReubenBond
@wanton7 Orleans loads your states concurrently today, so if you have multiple in a grain then they will be loaded concurrently.
wanton7
@wanton7
@ReubenBond I know but I would want to keep that same possibility with lazy state loadong.
Reuben Bond
@ReubenBond
Sure thing, makes sense. I think we would naturally allow that via var states = await Task.WhenAll(state1.GetAsync(), state2.GetAsync()), or some variant
1 reply
ifle
@ifle
Remainder azure table has the field DeploymentId. Are reminders depended on clusterid?
Reuben Bond
@ReubenBond
@ifle no, it's only there for diagnostics and for a test method (to delete table entries for the cluster)
ifle
@ifle
@ReubenBond Tnanks
@ReubenBond will to watch the talk
Jan Johansson
@jan-johansson-mr
Hi guys, can I take a grain reference, serailize it and then invoke a grain from that deserialized reference? As an example, I have a Player grain, and then I have the following: var player = clusterClient.GetGrain<IPlayer>(id), and do the following playerReference = player.AsReference<IPlayer>()
Following with some serialization (e.g. Json) of the reference
then how do I deserialize into a workable grain reference?
Reuben Bond
@ReubenBond
@jan-johansson-mr if the JSON serializer is configured correctly, then it will serializer and deserialize and work. You can configure it using the method on OrleansJsonSerializer, which adds the right contracts. Note that the method needs some things from DI
Vladyslav Horbachov
@LeftTwixWand
Hi. How is it possible to get all grains by specific criteria? For example:
GrainFactory.GetGrains<IUserGrain>().Where(user => user.Name.Contains("John"));
wanton7
@wanton7
@LeftTwixWand Indexing is not currently supported. What we do is not use Orleans state management currently and we use Entity Framework Core with Orleans. Another option we are currently thinking is that we inject something like IIndexManager for grains that needs indexing and when you change grain state that would effect index you call method from it to update index in database that support indexes. Example if you had CommentGrain you would call UpdateComment(grainId, ...). Then have all grain state in normal Orleans state as JSON blobs but you would have separate tables for grains that need indexing.
Rik
@rikbosch
just watched the orleans session https://www.youtube.com/watch?v=J9oJTKwASjA&feature=youtu.be&t=13560 from DotNetConf, great session @ReubenBond !
Jan Johansson
@jan-johansson-mr
@ReubenBond I kind of used the default [Orleans] serializer, and it works great! :-)
Thanks!
Vladyslav Horbachov
@LeftTwixWand
@wanton7 Can I do something useful to help Orleans team implement it faster?
24 replies
If something like this GetGrains<IUserGrain>().Where() will works - Orleans'll become to the best serverside solution.
Eugene Krapivin
@EugeneKrapivin
Hey, quick streams question: when a grain with id X is subscribed to events of stream id Y, when the grain is deactivated - does the runtime use id X to activate the grain or id Y?
Mike Lloyd
@mxplusb

I could use a sanity check. when I use the ISiloBuilder in aspnet core like this:

.UseOrleans(builder => {
    builder.UseLocalhostClustering()
        .Configure<ClusterOptions>(opts => {
            opts.ClusterId = "pine";
            opts.ServiceId = "v1";
        })
        .Configure<EndpointOptions>(opts => {
            opts.AdvertisedIPAddress = IPAddress.Loopback;
        })
        .ConfigureApplicationParts(parts => {
            parts.AddApplicationPart(typeof(CustomerGrain).Assembly).WithReferences();
        });
});

the WithReferences() method doesn't resolve and I get this build error: Program.cs(35,54): error CS1503: Argument 1: cannot convert from 'System.Reflection.Assembly' to 'Orleans.ApplicationParts.IApplicationPart'. I have the Microsoft.Orleans.Server and Microsoft.Orleans.Runtime.Abstractions installed, I thought that would include everything I need, but I think I might be missing something. what am I missing?

Reuben Bond
@ReubenBond
It's in the Orleans namespace, @mxplusb
From the Microsoft.Orleans.Core package
Mike Lloyd
@mxplusb
ah, for some reason Rider hadn't added the using Orleans; statement. lol thanks! I thought I was losing my mind.
Veikko Eeva
@veikkoeeva
May be of interest here due to distributed systems nature: https://blog.zkga.me/announcing-darkforest.
Omer Faruk Sayilir
@sayiliromer
Hello, is there an existing way to detect silo failure from "Grain Client" ?
Reuben Bond
@ReubenBond
@sayiliromer clients will automatically detect failure and avoid those servers. They will periodically retry previously "failed" servers to account for temporary network issues. There are also hooks on the client to receive an event when the number of connected servers changes