Commit 7a9dbe0b authored by Erik Seliger's avatar Erik Seliger Committed by GitHub

Fix additional files being deleted prematurely (#468)

* Fix additional files being deleted prematurely

When multiple containers use the same additional files, they could sometimes be deleted before the last container was done using them. Docker bind mount errors were happening then.
This fixes it by taking the workspace path into account for the local file path, making it truly unique between workspace runs.

* Update CHANGELOG.md
Co-authored-by: default avatarThorsten Ball <[email protected]>
parent b5497b64
......@@ -17,6 +17,8 @@ All notable changes to `src-cli` are documented in this file.
### Fixed
- Workspaces could sometimes fail with docker bind mount errors, due to a race condition of multiple workspaces accessing the same auxilliary files. [#468](https://github.com/sourcegraph/src-cli/pull/468)
### Removed
## 3.24.5
......
......@@ -96,7 +96,7 @@ func (rf *repoFetcher) zipFor(repo *graphql.Repository, workspacePath string) *r
for _, component := range pathComponents {
for _, name := range []string{".gitignore", ".gitattributes"} {
filename := path.Join(currentPath, name)
localPath := filepath.Join(rf.dir, repo.SlugForPath(filename))
localPath := filepath.Join(rf.dir, repo.SlugForPath(workspacePath+filename))
zip.additionalFiles = append(zip.additionalFiles, &additionalFile{
filename: filename,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment