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

Orleans AlwaysInterleave question #150

Closed
jason-bragg opened this issue Jan 24, 2019 · 3 comments
Closed

Orleans AlwaysInterleave question #150

jason-bragg opened this issue Jan 24, 2019 · 3 comments

Comments

@jason-bragg
Copy link

A few years back and attribute, AlwaysInterleave, was added to Orleans to support Orleankka.

dotnet/orleans#2246

The implementation of this feature allows grain calls attributed with AlwaysInterleave to interleave with other grain calls. However, these calls themselves are not interlaveable and will block a grain like any other grain call. We'd like to change this behavior such that call marked AlwaysInterleave both interleave with other grain calls, but also allows other grain calls to interleave with them. As this feature was added to support orleankka, we wanted to check to see if this change in behavior would violate the expectations of orleankka's usage patterns.

Can someone familiar with these behaviors please advise?
Thanks,
jbragg

@yevhen
Copy link
Member

yevhen commented Jan 27, 2019

Hi, Jason!

Did you mean MayInterleave or AlwaysInterleave attribute?

I don't mind changing the behavior of AlwaysInterleave to always interleave but as for MayInterleave I think it's better to leave it as now. IMHO, Orleans should have both options supported.

The ability to have calls which may interleave but not with others is crucial for a lot of use-cases, perhaps the most prominent is a so called system calls, which is kind of a special call that may not interleave with anything else. We have code that relies on this feature.

Example (from our system): we have a Projection actor that receives events that need to be projected on Elasticsearch index. For efficiency we batch index operations using timer and TaskCompletionSource, so senders got an ack only after the successful flush. On the other side, this actor participates in the complex index migration protocol which requires exclusive index access. When we send SwitchOver message to Projection actor it waits in Orleans queue until its turn and then executes exclusively, no event messages are processed concurrently (they're just sitting in Orleans queue).

Anyway, If we could have both options supported (and without breaking backward compatibility) - it's absolutely fine. Perhaps, some kind of boolean on MayInterleave which is false by default (ie current behavior?

@jason-bragg
Copy link
Author

Did you mean MayInterleave or AlwaysInterleave attribute?

This change is only for AlwaysInterleave. It has no effect on MayInterleave. This will not be strictly backwards compatible for the AlwaysInterleave behavior, as it will change the way calls with that attribution behave slightly.

@yevhen
Copy link
Member

yevhen commented Jan 29, 2019

I have no problem with that change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants