Skip to content

Fix crash if snapshotting a config_snapshot#5293

Merged
pks-t merged 1 commit intolibgit2:masterfrom
csware:config_snapshot-snapshot
Nov 5, 2019
Merged

Fix crash if snapshotting a config_snapshot#5293
pks-t merged 1 commit intolibgit2:masterfrom
csware:config_snapshot-snapshot

Conversation

@csware
Copy link
Copy Markdown
Contributor

@csware csware commented Nov 1, 2019

Partly fixes issue #5292.

@csware
Copy link
Copy Markdown
Contributor Author

csware commented Nov 1, 2019

Another approach (maybe with better performance) could be to just increase the reference counter and return the very same instance for config_snapshots.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
@ethomson
Copy link
Copy Markdown
Member

ethomson commented Nov 2, 2019

Interesting! It's snapshots all the way down!

turtle

I don't see why we wouldn't allow a snapshot to be created from another snapshot. This seems like a reasonable fix. I agree that it's not as performant as it could be but I also think that this is an uncommon enough use case (you're obviously the first person to try it 😀) that I'm happy enough to worry about the performance if/when it becomes an issue that you encounter. That is to say, if all users are happy enough with the perf, then I'm happy enough with the perf. 😄

I'd love @pks-t's thoughts.

Copy link
Copy Markdown
Member

@pks-t pks-t left a comment

Choose a reason for hiding this comment

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

Yup. When I implemented the generic snapshot backend I didn't yet want to go all in, but my intent was to make snapshots snapshottable, as well. It's nice to see all these refactorings in the config code to pay out in the end when there's only a single line needed to implement this.

Thanks a lot for your PR!

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.

3 participants