Comments (3)
Ideas on how to do the actual passivation.
-
The obvious approach is to have something similar to ReceiveTimeout, but didicated for killing idle actors.
this would give a fairly exact time until the actor is passivated. -
Another approach could be to per actor, keep track of when it's mailbox last ran.
And perform a sweep across the process registry, killing off idle actors.
This would be less exact. but might be cheaper and easier to implement.
Other thoughts?
from protoactor-go.
What if there are messages coming into the grain mailbox exactly when the grain is about to passivate?
Maybe actor can be recreated where you handle grpc's own timeout exception. (if such a thing exists)
This thread can be useful at some point: grpc/grpc-go#928
Any idea how Orleans handles this?
from protoactor-go.
Per How Activation-GC Works, Orleans just:
periodically scan for activations that have not been used at all for some period of time
And the scan is done by ScanStale(), which is called in an asynchronous task CollectActivationsImpl(). And each grain activation provides a method GetIdleness (), which is based on the internal state becameIdle. Much like approach 2 mentioned above:
- Another approach could be to per actor, keep track of when it's mailbox last ran.
And perform a sweep across the process registry, killing off idle actors.
This would be less exact. but might be cheaper and easier to implement.
For problem 1 mentioned above:
- What if there are messages coming into the grain mailbox exactly when the grain is about to passivate?
Orleans handles it in this way:
You can also instruct the runtime to deactivate the grain next time it becomes idle, by using:
protected void DeactivateOnIdle()
An activation is considered idle if it is not processing any message at the moment. If you call DeactivateOnIdle while a grain is processing a message, it will get deactivated as soon as processing of the current message is finished. If there are any requests queued for the grain, they will be forwarded to the next activation.
But seems protoactor-go
currently has no mechanism to forward (or persist) messages queued in mailbox. (maybe related to #139?)
from protoactor-go.
Related Issues (20)
- ensureTopicKindRegistered is not a good idea HOT 1
- subscriber may block PubSubMemberDeliveryActor
- Remove sprintf logging HOT 1
- Batch message sent twice? HOT 2
- Logging is a breaking change HOT 1
- MemberStrategy is not work!!!
- Go coroutine thread safe HOT 2
- Is every actor message Receiver run in they own goroutine ? HOT 1
- How can a member within a cluster be restarted? HOT 2
- How can I make ‘Spawn’ return the error that occurred when 'Started' is received? HOT 4
- Data Race
- Possible memory leak HOT 5
- Error when sending large message to remote actors HOT 1
- Context propagation
- The release tag "0.4.0" does not work
- Protoactor underperforms in certain benchmarks
- protoc-gen-gograinv2 cannot recognize google.protobuf.Empty
- How to do grain reentrance HOT 2
- Improve code generation HOT 1
- Remove GrainResponse HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protoactor-go.