semver: Bug: "another git process seems to be running..." in sync mode
I’m still trying to reproduce the issue myself, since it pops up occasionally in my CI even with it inline.
Right now I’m having doubts as to whether or not “parallel” changes the behavior at all, or with what runners does it change the behavior, or if it only affects certain commands, such as nx run-many
.
One possible guess is here:
There might be a race condition with performing concurrent addToStage() since we’re using concatMap, so each project is still being updated in parallel. It’s hard to reproduce though, but if the changes at addToStage were performed sequentially it might help in my case.
In your case, my guess is that the addToStage() from updating the changeLogs and updating the packageJson hit at the same time, since those are also done in parallel:
_Originally posted by @dereekb in https://github.com/jscutlery/semver/issues/500#issuecomment-1129200958_
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 18 (7 by maintainers)
Commits related to this issue
- chore: don't run versioning in parallel to avoid annoying git lock bug See https://github.com/jscutlery/semver/issues/507#issuecomment-1157274197 — committed to buildquick/buildquick by ersinakinci a year ago
This issue happens all the time with
affected
andrun-many
unless I use--parallel=1
.Your issue sounds the same as the other person’s here.
https://github.com/jscutlery/semver/issues/500#issuecomment-1126896815
It’s a tricky bug to reproduce, although I guess we know it is still happening for new projects that might not have that big of size. Wasn’t occurring on my machine at home, but was occurring sometimes on CircleCI, until I made a large enough release that it triggered every time. The race condition occurs on the filesystem.
I haven’t checked the e2e tests so I can’t speak to that, but if it isn’t invoking git on the CI machine directly then it won’t catch it.
This is still happening and its not clear that this race condition exists unless you have to force it to run serially. Our pipeline hangs when we run everything serially so this doesnt fix the issue on our end
@nradulaski-godaddy thanks for the feedback, I think it means the underlying issue is fixed in semver, but we have to document the usage of
--parallel=1
or handle it in the install generator so it’s transparent to the user.I assume the easiest way to reproduce it as add the
releaseAs=<SOME_SEMVER>
flag to activate full release for all the packages. going to start and work on this now. btw, I believe that removing allRxJS
in favor or promises will resolve this race condition issue…