Compare pointers rather than ids in Scheduler::notifyExecutorShutdown #144
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a rare "race" condition I encountered when the gid counter overflows due to many messages flowing through the system, and two executors collide with the same id. With this fix the executor IDs are not used for comparing them anymore, just for debug printing where the collisions don't matter for the correctness of the runtime (though the gids should probably be 64-bit integers and include some sort of configurable machine id, it doesn't take that long to overflow 32-bit counters - especially as one gid counter is shared to generate IDs for all kinds of objects, including messages).
The pointers are guaranteed to be the same because they're both generated from the same shared_ptr pointee address, adjusted for the position of the Executor* vtable.