orleans icon indicating copy to clipboard operation
orleans copied to clipboard

ManagementGrain.ForceActivationCollection with zero ageLimit causes undesired effects

Open alirezajm opened this issue 8 years ago • 4 comments

Calling ManagementGrain.ForceActivationCollection(TimeSpan.Zero) collects every grain, including system grains and the ManagementGrain itself. Which effectively almost restarts the silo and causes the said grain call to timeout.

Shouldn't this exclude some grains (management grain, pubsub, etc.)? or at least make the TimeSpan.Zero value an invalid one?

I can't think of a scenario where current behavior would be useful.

alirezajm avatar Aug 29 '18 07:08 alirezajm

@benjaminpetit any word on this?

alirezajm avatar Sep 17 '18 06:09 alirezajm

I'm not convinced that we should be doing anything to prevent the user from calling with a zero or very short timespan.

If you'd like to submit a PR to implement a minimum value, then please feel free. I wouldn't be opposed to merging it.

Some grains are already excluded from activation collection, so we could add a mechanism to exclude more grains or to exclude them more generally (eg an attribute, like the recently added attribute in #4890). I would be wary of a general mechanism, though, since it's an anti-pattern to have activations live forever.

ReubenBond avatar Sep 17 '18 07:09 ReubenBond

I'm not convinced that we should be doing anything to prevent the user from calling with a zero or very short timespan.

If you'd like to submit a PR to implement a minimum value, then please feel free. I wouldn't be opposed to merging it.

Yeah it's not a big deal at all. It's just that you can't predict what will happen.

Some grains are already excluded from activation collection Are the ManagementGrain and the SiloGrain included in that exclusion? 🤔 If so I might have made a mistake about the managementGrain itself being collected (which was weird as how can it be collected while processing a call).

Agreed about the anti-pattern but there are already some grains breaking that pattern. I personally haven't felt the need for that though. There were times I though about it but I could solve the issue another way. if interested I can tell you an example.

alirezajm avatar Sep 18 '18 14:09 alirezajm

Thanks for contacting us. We believe that the question you've raised has been answered. If you still feel a need to continue the discussion, feel free to reopen the issue and add your comments.

ghost avatar Dec 30 '21 05:12 ghost