Skip to content

Bundle_extraction_is_reused intermittently fails with "text file is busy" #44657

Closed

Description

@runfoapp

Runfo Tracking Issue: Bundle_extraction_is_reused intermittently fails with "text file is busy"

Build Definition Kind Run Name

Build Result Summary

Day Hit Count Week Hit Count Month Hit Count
0 0 0

Activity

  1. Dotnet-GitSync-Bot commented on Nov 13, 2020

    @Dotnet-GitSync-Bot
    Collaborator

    I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

  2. added
    blocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
    on Dec 6, 2020
  3. eerhardt commented on Dec 9, 2020

    @eerhardt
    Member

    This failed again here:

    https://dev.azure.com/dnceng/public/_build/results?buildId=913629&view=logs&j=488ba465-33f8-5af3-b422-ec6526547df5&t=6c6997ae-4d39-5a90-21e3-089719c051c1&l=525

    https://dev.azure.com/dnceng/public/_build/results?buildId=913629&view=ms.vss-test-web.build-test-results-tab&runId=29085272&resultId=100002&paneView=debug

    Error message
    System.ComponentModel.Win32Exception : Text file busy
    
    
    Stack trace
       at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
       at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
       at System.Diagnostics.Process.Start()
       at Microsoft.DotNet.Cli.Build.Framework.Command.Start() in /_/src/installer/tests/TestUtils/Command.cs:line 199
       at Microsoft.DotNet.Cli.Build.Framework.Command.Execute(Boolean fExpectedToFail) in /_/src/installer/tests/TestUtils/Command.cs:line 239
       at Microsoft.DotNet.Cli.Build.Framework.Command.Execute() in /_/src/installer/tests/TestUtils/Command.cs:line 171
       at AppHost.Bundle.Tests.StaticHost.Can_Run_SingleFile_App_With_StatiHost() in /_/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/StaticHost.cs:line 44
    
  4. vitek-karas commented on Dec 9, 2020

    @vitek-karas
    Member

    The last thing we do on the executable before we call Process.Start (which fails) is this:

    // Memory-mapped write does not updating last write time
    RetryUtil.RetryOnIOError(() =>
    File.SetLastWriteTimeUtc(appHostPath, DateTime.UtcNow));

    The Retry has logic to try 500 times (with a short sleep) and if it still fails - then throw. So unless something is really weird, then the SetLastWriteTimeUtc actually succeeded before it's done.

    I don't know Linux file system enough to be able to tell if the SetLastWriteTime even requires the file to be "non-busy" - if it can work on "busy" files, then the one we call which actually modifies the content of the file is this:

    using (var mappedFile = MemoryMappedFile.CreateFromFile(filePath))
    {
    using (var accessor = mappedFile.CreateViewAccessor())
    {
    SearchAndReplace(accessor, searchPattern, patternToReplace, pad0s);
    }
    }

    This has usings around the right stuff - so it should close the file once it's done.

  5. agocke commented on Dec 11, 2020

    @agocke
    Member

    I think some more info would be helpful. I'm going to try to run strace and get the syscall log to see if I can figure out what's going on under the hood here.

    We'll also need to move this entire test into staging unfortunately -- it's too noisy to continue running in all PRs.

  6. added a commit that references this issue on Dec 11, 2020
  7. added a commit that references this issue on Dec 22, 2020
  8. directhex commented on Mar 3, 2021

    @directhex
    Contributor

    Closing, fixed by #45976

  9. 4 remaining items

  10. removed
    untriagedNew issue has not been triaged by the area owner
    on Mar 3, 2021
  11. added this to the 6.0.0 milestone on Mar 3, 2021
  12. removed this from the 6.0.0 milestone on Apr 6, 2021
  13. reopened this on Apr 6, 2021
  14. safern commented on Apr 6, 2021

    @safern
    Member

    Reopening as this is on the runtime-staging pipeline.

  15. VincentBu commented on May 24, 2021

    @VincentBu
    Contributor

    Failed in runtime 20210523.14

    Failed test:

    Installer-coreclr-Linux_x64-Release
    
    - AppHost.Bundle.Tests.BundleExtractToSpecificPath.Bundle_Extraction_To_Relative_Path_Succeeds(relativePath: \"foo/bar\", bundleOptions: BundleAllContent)
    
    

    Error message:

    System.ComponentModel.Win32Exception : Text file busy
    
    
    Stack trace
       at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
       at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
       at System.Diagnostics.Process.Start()
       at Microsoft.DotNet.Cli.Build.Framework.Command.Start() in /_/src/installer/tests/TestUtils/Command.cs:line 199
       at Microsoft.DotNet.Cli.Build.Framework.Command.Execute(Boolean fExpectedToFail) in /_/src/installer/tests/TestUtils/Command.cs:line 239
       at Microsoft.DotNet.Cli.Build.Framework.Command.Execute() in /_/src/installer/tests/TestUtils/Command.cs:line 171
       at AppHost.Bundle.Tests.BundleExtractToSpecificPath.Bundle_Extraction_To_Relative_Path_Succeeds(String relativePath, BundleOptions bundleOptions) in /_/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundleExtractToSpecificPath.cs:line 87
    
  16. VincentBu commented on Jun 3, 2021

    @VincentBu
    Contributor

    Failed again in runtime 20210602.73

    Failed test:

    Installer-coreclr-Linux_x64-Release
    
    - AppHost.Bundle.Tests.BundleExtractToSpecificPath.Bundle_Extraction_To_Relative_Path_Succeeds(relativePath: \"./foo\", bundleOptions: BundleAllContent)
    
    

    Error message:

    System.ComponentModel.Win32Exception : Text file busy
    
    
    Stack trace
       at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
       at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
       at System.Diagnostics.Process.Start()
       at Microsoft.DotNet.Cli.Build.Framework.Command.Start() in /_/src/installer/tests/TestUtils/Command.cs:line 199
       at Microsoft.DotNet.Cli.Build.Framework.Command.Execute(Boolean fExpectedToFail) in /_/src/installer/tests/TestUtils/Command.cs:line 239
       at Microsoft.DotNet.Cli.Build.Framework.Command.Execute() in /_/src/installer/tests/TestUtils/Command.cs:line 171
       at AppHost.Bundle.Tests.BundleExtractToSpecificPath.Bundle_Extraction_To_Relative_Path_Succeeds(String relativePath, BundleOptions bundleOptions) in /_/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundleExtractToSpecificPath.cs:line 87
    
  17. danmoseley commented on Jun 3, 2021

    @danmoseley
    Contributor

    @agocke we seem to be continuing to hit this (I think there is another issue as well)

  18. agocke commented on Jun 3, 2021

    @agocke
    Member

    We moved the original stuff to the staging branch, must have missed it on alpine. @VSadov is seeing if he can succeed where I failed -- if we don't have any ideas we can move this one to staging as well.

  19. agocke commented on Aug 30, 2021

    @agocke
    Member

    Duplicate of #53587

  20. ghost locked as resolved and limited conversation to collaborators on Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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