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

mgit bootstrap fails randomly due to concurrency #23

Closed
Reinmar opened this issue Jan 19, 2017 · 4 comments
Closed

mgit bootstrap fails randomly due to concurrency #23

Reinmar opened this issue Jan 19, 2017 · 4 comments
Assignees
Labels
resolution:solved type:task This issue reports a chore (non-production change) and other types of "todos".

Comments

@Reinmar
Copy link
Member

Reinmar commented Jan 19, 2017

https://travis-ci.org/ckeditor/ckeditor5-undo/builds/193346289#L1348:

 @ckeditor/ckeditor5-utils                                           20/31 (65%) 
fatal: destination path '/home/travis/build/ckeditor/ckeditor5-undo/packages/ckeditor5-utils' already exists and is not an empty directory.

I've seen this error couple of times already.

@Reinmar Reinmar self-assigned this Jan 19, 2017
@Reinmar
Copy link
Member Author

Reinmar commented Jan 19, 2017

OK, the error comes from the fact that we try to install @ckeditor/ckeditor5-paragraph after installing ckeditor5-paragraph.

We need to decide what the name in mgit.json's deps is supposed to be. I think it should mean the package name. Initially, it was the directory name, but now directory is returned by the resolver.

@Reinmar
Copy link
Member Author

Reinmar commented Jan 19, 2017

I'll fix it in https://github.com/ckeditor/ckeditor5-dev so the mgit.json is created with proper scoped names. This will prevent conflicts. But we'll still need to fix documentation in mgit2 to match what I described in the previous comment.

@Reinmar Reinmar added status:confirmed type:task This issue reports a chore (non-production change) and other types of "todos". labels Jan 19, 2017
@pomek
Copy link
Member

pomek commented Jan 19, 2017

OK, the error comes from the fact that we try to install @ckeditor/ckeditor5-paragraph after installing ckeditor5-paragraph.

The error comes because one thread wants to install ckeditor5-paragraph and another thread wants to install the same package. The first thread installed it correctly, the second one tries to install it too. After checking the condition "check whether the package exists" (which returns false), the package appeared (in the first thread) and the second thread cannot clone it.

I try to show it:

first thread - install @ckeditor/ckeditor5-paragraph
second thread - install ckeditor5-paragraph
first thread - resolve directory for the package: packages/ckeditor5-paragraph
second thread - resolve directory - packages/ckeditor5-paragraph
first thread - check whether the directory exists - false
second thread - the same as the first
first thread - clone package
second thread - clone package - throws the error because first thread was faster

To be honest, I don't know how we can prevent it.

Reinmar added a commit to ckeditor/ckeditor5 that referenced this issue Jan 19, 2017
@Reinmar
Copy link
Member Author

Reinmar commented Jan 19, 2017

The error comes because one thread wants to install ckeditor5-paragraph and another thread wants to install the same package.

Well, it's only partially true. I explained why we dispatch the bootstrap command for twice for the same repository – it's because of the name. First mgit takes ckeditor5-paragraph from mgit.json and then gets @ckeditor/ckeditor5-paragraph from some dependency package.json.

The solution is, as I mentioned, consistent naming. I fixed ckeditor5-dev-tests already (https://github.com/ckeditor/ckeditor5-dev/issues/50) and ckeditor5 (ckeditor/ckeditor5@4e3cc38).

In mgit itself we just need to fix the documentation to clearly state what is the name supposed to mean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution:solved type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
Development

No branches or pull requests

3 participants