Skip to content

Compare pointers rather than ids in Scheduler::notifyExecutorShutdown #144

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

Merged
merged 1 commit into from
Sep 28, 2021

Conversation

eigenraven
Copy link
Collaborator

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.

@Shillaker Shillaker merged commit 7578073 into faasm:master Sep 28, 2021
@eigenraven eigenraven deleted the fix-executor-cleanup branch September 28, 2021 15:39
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

Successfully merging this pull request may close these issues.

2 participants