Skip to content

GitVersion concurrency issue when accessing cache #918

@simonejsing

Description

@simonejsing

We have a parallelized build that uses GitVersion in individual msbuild projects. GitVersion seems to have a concurrency issue when multiple concurrent process are accessing the cache which results in build warnings. According to the warning this results in undefined assembly versions.

Is this considered a bug, or should we be avoiding concurrent GitVersion calls?
Is there an argument to bypass the cache?

The warning that is generated is:
MSBUILD : warning : WARN [06/29/16 15:43:29:33] Could not determine assembly version: System.IO.IOException: The process cannot access the file 'C:\Workspace\HCM\ApplicationCommon.git\gitversion_cache\B80F8F1DCE4B87563E9EE9C979A45AEE8086132C.yml' because it is being used by another process.
MSBUILD : warning : at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
MSBUILD : warning : at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
MSBUILD : warning : at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
MSBUILD : warning : at System.IO.File.OpenWrite(String path)
MSBUILD : warning : at GitVersion.Helpers.FileSystem.OpenWrite(String path)
MSBUILD : warning : at GitVersion.GitVersionCache.WriteVariablesToDiskCache(IRepository repo, String gitDir, VersionVariables variablesFromCache)
MSBUILD : warning : at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig)
MSBUILD : warning : at GitVersion.ExecuteCore.TryGetVersion(String directory, VersionVariables& versionVariables, Boolean noFetch, Authentication authentication)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions