Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 01:21
    tcoats starred dotnet/orleans
  • 00:10
    artemiusgreat closed #6763
  • Jun 19 23:45
    ajay-dotnet starred dotnet/orleans
  • Jun 19 15:54
    PiotrJustyna converted_to_draft #7124
  • Jun 19 15:52
    PiotrJustyna commented #7124
  • Jun 19 15:20
    ReubenBond edited #7099
  • Jun 19 14:52
    ReubenBond commented #7124
  • Jun 19 13:33
    PiotrJustyna commented #7124
  • Jun 19 09:48
    SebastianStehle commented #7110
  • Jun 19 09:41
    nkosi23 commented #7110
  • Jun 19 08:49
    SebastianStehle commented #7124
  • Jun 18 21:57
    ReubenBond opened #7125
  • Jun 18 21:44
    PiotrJustyna opened #7124
  • Jun 18 21:22
    ReubenBond commented #7062
  • Jun 18 21:22

    ReubenBond on main

    Fix SonarQube's "Any() should b… (compare)

  • Jun 18 21:22
    ReubenBond closed #7080
  • Jun 18 21:21
    ReubenBond edited #7121
  • Jun 18 20:54
    ReubenBond synchronize #7122
  • Jun 18 20:37
    starcraft66 starred dotnet/orleans
  • Jun 18 20:15
    ReubenBond milestoned #7123
Alex McCool
@amccool
from in a grain, I need to call another Grain (and wait for it to finish) how can I prevent the timeoutexception if that grain call goes over 30 seconds?
David Simões
@examinus-
you could change the way you're thinking, use properties on the target grain to check periodically from the calling grain if it's done(like a job list) or the target grain will call the first grain when it's done, or you can use streams for publishing the "progress" and the calling grain just subscribes to the stream... I suppose it really depends on what you want and what you are doing :)
Alex McCool
@amccool
I suppose what would look best is a clean way to make a grain call that doesnt throw a orleanstimeoutexception. This particular operation can be long running, and I need to wait for its return to move to the next step in the workflow. Perhaps I need to have a peek at the Saga pattern in contrib
Sam Ember
@SamEmber
Good morning, looking for some guidance around the cost of the GetGrain call when the grain is already activated. Am I OK to repeatedly call GetGrain or should I keep a local copy of the grain reference, Is it expensive to get a ref to an already activated grain? What would happen if I kept a copy and the referenced grain was deactivated and re activated elsewhere on a different silo?
Gabriel Freire
@gabrielfreire

Hi Guys, i'm having Reminder problems again, i'm kind of lost because i don't understand why i'm having these problems
Orleans version 3.4.2

Orleans.Runtime.OrleansMessageRejectionException: SystemTarget *stg/0/00000000 not active on this silo. Msg=Request S10.42.104.46:11113:357845393*grn/Grains.NotificationReminderManager/0+sp_core_reminders_repository@4003479c->S10.42.166.190:11111:357038348*stg/0/00000000@S00000000 InvokeMethodRequest Orleans.IReminderService:RegisterOrUpdateReminder #239
   at Orleans.Internal.OrleansTaskExtentions.<ToTypedTask>g__ConvertAsync|4_0[T](Task`1 asyncTask)
   at Grains.NotificationReminderManager.StartOrUpdateReminderAsync(CoreReminder coreReminder, TimeSpan dueTimeInSeconds) in /src/Grains/NotificationReminderManager.cs:line 153

It works fine locally, but when i deploy to kubernetes along with other silos, i get the error above.

I don't think the reminder is not registered in the silo as i'm waiting around 3 minutes after the service has started and the Silo has been active before calling the API,

I was using AdoNet Reminder adapter but changed to InMemory to see if that's what causing problems, no success, i get the same error.

can anyone help with Reminders on kubernetes please ?

dougclayton
@dougclayton
My understanding is creating a reference is very cheap, but of course it wouldn’t hurt to hoist it out of the inner loop. But there’s no comparison to the cost of actually making a call. Also it is a persistent reference so you definitely should not make a “new one” because the grain moved—that is transparent to the caller, by design.
Reuben Bond
@ReubenBond
Creating a grain reference is cheap, but not free, so I would personally keep them around where it makes sense (where it's low effort and doesn't impact code clarity)
Alex McCool
@amccool
hi all - is there anyway to prevent a grain call from throwing a OrleanTimeoutException in the caller? In this particular case I know its a long running call, but I need to await its completion.
6 replies
Oisin Grehan
@oising
Anyone know if it's possible to Moq/mock ITimerRegistry? I've got a service where I'm injecting the hosting grain's timer registry, and I want to test the service standalone using OrleansTestKit. I can't find any guidnace here
Ah, I spend 30 minutes looking and find nothing. I post a q here, then find the answer 45 seconds later
Test class must derive from TestKitBase, then there's a Silo.TimerRegistry which can be passed in
Oisin Grehan
@oising
No need to create a mock grain
jmairena-s3d
@jmairena-s3d

Hello!
Could someone take a look at this pull request: OrleansContrib/Orleans.Redis#14 ?

I guess OrleansContrib repository is not followed as much as the main one, but this change is needed since a long time ago by Redis.
Thanks!

Eugene Krapivin
@EugeneKrapivin
watching this https://www.youtube.com/watch?v=an87dzgAMR8 video, got some question about grain ids:
a. would it be possible to have a migration interface for existing systems that already have data and wish to move forward to the new schema?
b. would it be possible to have a KeyProvider<TGrainInterface> to allow custom keys?
Vincent Hoogendoorn
@VincentH-Net

Question: is Orleans [Immutable] and Immutable<T> still recommended to use today to improve Orleans codegen/serialization performance?
And will that change once C# 9 record is supported?

The docs seem quite old (copyright 2016?):
https://orleanscn.github.io/orleans/Documentation/Advanced-Concepts/Using-Immutable-to-Optimize-Copying.html
https://orleanscn.github.io/orleans/Tutorials/Concurrency.html#messages

Reuben Bond
@ReubenBond
@VincentH-Net it's recommended to use those attributes for performance in the cases where your objects are immutable. Use them judiciously. C# records are not immutable, especially not deeply immutable: any typical collection type on a record still needs to be copied
Vincent Hoogendoorn
@VincentH-Net
Thanks @ReubenBond, that clarifies it.
Vincent Hoogendoorn
@VincentH-Net
PS @ReubenBond so for immutable message type method parameters, would it make sense to combine [Immutable] and record? If yes, will Orleans do that automatically?
I can imagine that the compiler's awareness of records would be helpful in preventing violating immutability in code, even if a record is not truly/deeply immutable .
Reuben Bond
@ReubenBond
@jmairena-s3d yes, thanks for the prod. I've merged it and an updated package will be on nuget.org soon
@VincentH-Net the current code generator doesn't support C# records, unfortunately. Records don't change any semantics, though, so they don't help the compiler - especially not any more than a get-only or init-only property on a regular class
jmairena-s3d
@jmairena-s3d
Thanks @ReubenBond ! ^_^
dougclayton
@dougclayton
Besides, if i recall correctly, there is not currently any way to detect if a type is a record at runtime.
soerendd
@soerendd
Can I call clusterclient.getgrain from multiple threads or many grain references to be used in different threads?
So the second case would be create a client and query many grain references and use them in different threads.
Vincent Hoogendoorn
@VincentH-Net

@ReubenBond the reason I am interested in using C# records in Orleans method parameters is the concise syntax. E.g.:

[Immutable]
public class CallParty
{
    public string Name { get; init; }
    public string Address { get; init; }
    public string UserId  { get; init; }
}

could become

[Immutable]
public record CallParty(string Name, string Address, string UserId);

Also records eliminate writing code for value equality, hash code - many loc.

Since records are just classes with generated code, I imagine that adding the [Immutable] attribute could just work...
if records will be supported. Are there any plans to support record in Orleans method parameters?

Reuben Bond
@ReubenBond
I get it, @VincentH-Net - they are nice and terse. We will have to update the Roslyn version in the code generator to support record syntax. Previously, there were some issues preventing us from doing that. We may be able to update the package now and add records support for 3.5.0
pawanrao
@pawanrao
hi all, I'm trying to profile certain grain methods in our code
is there any way to glean into the queued requests for a particular grain method/call?
Reuben Bond
@ReubenBond
In other words: I hope we can add support for records in 3.x, and we can certainly support them for 4.x
@pawanrao there is currently no programmatic way to do that, but you will receive status updates for methods which take a long time to complete (eg, because they are stuck behind some other method call). We could have a helper class which allows you to introspect a grain's queue - what kind of information are you looking for?
Reuben Bond
@ReubenBond
@jmairena-s3d version 3.1.1 is on nuget.org now
pawanrao
@pawanrao

@ReubenBond we are basically looking for metrics that would help us identify potential bottlenecks since code flow sometimes gets complex.

At the moment, we don't really know where to look to identify such issues. This includes not just grain calls but the streaming infrastructure as well

Reuben Bond
@ReubenBond
The information which the OrleansDashboard gives you might be helpful there, @pawanrao
dougclayton
@dougclayton
@soerendd yes, ClusterClient is thread safe and meant to be shared
Vincent Hoogendoorn
@VincentH-Net
@ReubenBond thanks, C# record support in 3.5/x would be great!
I subscribed to existing record issues #7033 and #6822; there does not seem to be an issue for "Support C# records in grain method parameters and return value". Should I add one?
pawanrao
@pawanrao

@ReubenBond we do have OrleansDashboard integrated but that gives a high level overview.
Do "Methods with Highest Latency" include time queued on the activation task scheduler?
Does it have any metrics regarding activation metrics(new activations/time to activate) etc

what we are looking for is to identify potential bottlenecks and improve performance
e.g a grain call or a stream message processing took 500ms when under normal circumstances it probably takes way less than that
We have no idea why it took that long or what we could to improve its performance

Reuben Bond
@ReubenBond
@VincentH-Net yes, thanks
@pawanrao if it's a specific method invocation which needs to be profiled, then I agree that tools which only expose aggregates will likely not help. You would likely need either distributed tracing which captures that specific call or to attach a traditional profiler (such as dotnet trace or dotTrace)
Vincent Hoogendoorn
@VincentH-Net
@ReubenBond done! #7076
Reuben Bond
@ReubenBond
Thanks, @VincentH-Net :)
Andrej Kyselica
@andrejpk
Before I go down a particular path, does anyone know if the Orleans code generator has problems working in a project with C# strict nulls enabled?
3 replies
Reuben Bond
@ReubenBond
@VincentH-Net related to your query about record syntax, I am planning to also add support for adding [Immutable] to parameters & return types on grain interfaces, so that wrapping values in Immutable<T> will be much less necessary
That would have to wait for 4.x, though
Michael Kranz
@michasHL
Is there a configurable way for the streaming infrastructure (specifically Event Hub) to just work in a publisher fashion without creating pulling agents?
Andrej Kyselica
@andrejpk
I need to make a decision on immutable types.. the coding overhead without the 'with' statement is painful. Is there an estimated timeline for 3.5? If it's close, I'll wait but if not I'll just make it all mutable for now and be extra careful about the data flows.
Gabriel Freire
@gabrielfreire
hi guys, did anybody use Reminders on kubernetes already ? if yes, how did you do it ? is it open-source ? can somebody point me to any example ?
nickshrayer
@nickshrayer

HELP! I am using AdoNet clustering provider (which stores membership info in OrleansMembership DB table). I need to use toxiproxy proxy to simulate network outage and so I make use of an option to specify SiloPort different than port at SiloListeningEndpoint in Orleans EndpointOptions (at silo build time). This is a documented option to be used in case of port forwarding. What I observe is that OrleansMembership table contains "advertised port number" (the one specified as SiloPort). Which is correct. But AdoNet cluster membership provider attempts to update IAmAliveTime specifying a WHERE taking port number of SiloListeningEndpoint. Thus after 5 min silo decides it itself is dead (b/c no keep-alives are marked in DB) and kills itself with fatal error

@ReubenBond , @benjaminpetit - why???

Reuben Bond
@ReubenBond
@nickshrayer can you submit a fix? @veikkoeeva for awareness.
Are you able to modify the queries locally for now, @nickshrayer? I.e, by modifying the SQL file templates that those providers are packaged with
40 replies
Gabriel Freire
@gabrielfreire
hi guys, created dotnet/orleans#7078
Sunny Li
@sunniejai
Is there something built into Orleans that stops a Grain call after a certain amount of time? I have some code that Task.Delay(45 seconds) because of some API limits, and somehow the method just seems to end there? No exception or anything? Not sure if the grain got deactivated, but I already added something to DelayDeactivation before awaiting the 45 seconds