Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Fix racing condition on adding directories #315

Closed
daviddias opened this issue Jun 7, 2016 · 9 comments
Closed

Fix racing condition on adding directories #315

daviddias opened this issue Jun 7, 2016 · 9 comments
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)

Comments

@daviddias
Copy link
Member

A racing condition was introduced when adding directories 'recursively'

#312 (comment)

It doesn't happen always, we need to make a test that always detects it and fix it

@daviddias daviddias added kind/bug A bug in existing code (including security flaws) help wanted Seeking public contribution on this issue labels Jun 7, 2016
@dignifiedquire
Copy link
Member

dignifiedquire commented Aug 3, 2016

This a351eb0 should fix the issue, but I am not a 100% sure as I couldn't reproduce the referenced race myself.

@daviddias
Copy link
Member Author

daviddias commented Aug 3, 2016

Can you add a test with a lots of tiny files (like 100) and at least 10 levels of nest'ness, just to be sure? Thank you!

@dignifiedquire
Copy link
Member

Can you add a test with a lots of tiny files (like 100) and at least 10 levels

All the files :D

@daviddias
Copy link
Member Author

Note that sorting on the client should not matter, go-ipfs doesn't expect the things to come sorted through the http-api. Files are hashed first and them the dir nodes are constructed after, once there is no more files to add to the dir (flush: false) or keep getting recreated (flush: true)

@dignifiedquire
Copy link
Member

I added the sorting to make it easier to test, as it makes the output deterministic.

@daviddias
Copy link
Member Author

A good test to add is to add the same dir, but by a different order.

@dignifiedquire
Copy link
Member

dignifiedquire commented Aug 3, 2016

Race is still there :( seems to be related to how the unixfs stream module thing works rather than how we use it from js-ipfs :(

@daviddias
Copy link
Member Author

@dignifiedquire is this still a bug with the new pull-streams based unixfs engine?

@dignifiedquire
Copy link
Member

Never seen it in pull-streams land

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

2 participants