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

Fixed create fn to return false if node already exists #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fixed create fn to return false if node already exists #9

wants to merge 1 commit into from

Conversation

EugenDueck
Copy link

The doc string says If the node already exists, create will return false. but the implementation returned the path of the node instead.

I fixed this (so that callers of create can distinguish the two cases), but this is a breaking change, so if other code (like e.g. in avout) already depends on the "contra-documented" feature, it will break.

create-all is such an example which could fail due to the change in create's return value, had I not also taken care of that.

With the old version of create-all, in case of a rare race condition where the node in question is created by another process or thread in-between the call to (exists ... node) and the subsequent call to (create ... node),

The doc string says `If the node already exists, create will return false.` but the implementation returned the path of the node instead.

I fixed this (so that callers of `create` can distinguish the two cases), but this is a breaking change, so if other code (like e.g. in `avout`) already depends on the "contra-documented" feature, it will break.

`create-all` is such an example which could fail due to the change in `create`'s return value, had I not also taken care of that.

With the old version of `create-all`, in case of a rare race condition where the node in question is created by another process or thread in-between the call to `(exists ... node)` and the subsequent call to `(create ... node)`,
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.

1 participant