Open alex023 opened 7 years ago
reflect.ValueOf(pid).IsNil()
How much overhead will this add? I am all for such change, but we should be careful with how much this kind of changes affect spawning performance
There are several ways to create an object instance, like FromProducer , FromInstance , WithProducer . At present, my proposal to intercept the occurrence of the error, but also does bring the performance overhead, which will make my MPB (CPU i5) performance overhead of about 7ns each time. Look for a better solution!
I think this proposal is missing the point. incarnateActor
shouldn't care whether what the actor is, whether it is nil
, a pointer, a struct value, or a function. The problem described above can happen in any non-nil
actor that insists on panicking. I think the real solution is to make the supervisor give up trying to stop the child.
Problem Description:
The go interface structure involves two basic properties: (type, data). At run time, it may be (nil, nil), and mayby be (actor.Actor, nil). Once the latter situation, it is likely that the system will keep sending *actor.Stopping message , even if we add SUPERVISION.
Code example:
we will get output,and soon, the log data will become very large
Suggest:
In business development, it is difficult to avoid creating a null pointer actor object, which in turn causes the system to fail.(without kotlin's syntax). Therefore, it is necessary to add judgment and improve robustness in the framework. Perhaps, refactor
incarnateActor
in the local_context.go is a good choice: