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

#621 Termination clear out state after term detected #622

Merged
merged 13 commits into from
Dec 18, 2019

Conversation

lifflander
Copy link
Collaborator

@lifflander lifflander commented Dec 17, 2019

Fixes #621

@lifflander lifflander added this to the 1.0.0-beta milestone Dec 17, 2019
@lifflander lifflander self-assigned this Dec 17, 2019
@lifflander lifflander marked this pull request as ready for review December 17, 2019 22:46
// We are likely inside code that references the map structure that holds DS
// terminators. We can remove it safely. So we will enqueue an action to do
// the cleanup. This action must see if the DS term is still disengaged (it
// can easily be re-engaged after it disengages)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment on outstanding references doesn't give me a whole lot of confidence that we won't have dangling reference bugs anyway.

If we want to be safe against that, we can work with objects whose lifetimes actually track such references to specific epochs, rather than the raw epoch numbers.

Alternately, the interface presented by StateDS can be better encapsulated so that references don't leak out, and it handles operations on epochs by number regardless of what state they've ended up in.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've improved the comment in the code. I agree with you about lifetimes, but that would be a major refactor. Are you comfortable with the code as is?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it holds up in practice for now, yeah, I'm fine going ahead with this.

@PhilMiller
Copy link
Member

I think your fixes are OK, but I'll have to spend a bunch more time with the surrounding code to be more confident.

@lifflander lifflander merged commit 38ffec8 into develop Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Epochs not being cleared for state in TD
2 participants