Paket icon indicating copy to clipboard operation
Paket copied to clipboard

Paket 'hangs' without any output for several minutes

Open matthid opened this issue 8 years ago • 5 comments

Description

Started a build in VS 2017 (net sdk integration):

1>Build started 2018-11-08 10:47:19.
1>Target PaketRestore:
1>  Paket version 5.181.1

// after some minutes

1>  Starting full restore process.
1>  Performance:
1>   - Disk IO: 191 milliseconds
1>   - Runtime: 3 minutes, 17 second

Repro steps

Not clear but there shouldn't be too many places in the code which can be responsible before Starting full restore process and after printing the version.

This seems to happen when VSCode + Visual Studio 2017 is open and I add a new package with paket install and "rightclick -> build" in Visual Studio (I guess VSCode or VS is doing some paket commands behind the scenes)

Expected behavior

I feel like paket is waiting for another process to exit and should tell me that. Even better would be to just work faster ;)

Actual behavior

Nothing

Known workarounds

Wait

matthid avatar Nov 08 '18 09:11 matthid

@matthid any chance you could have a look at it with Process Explorer, and see if any dotnet processes hangs with "dotnet paket --version"? I've seen that quite a few times. Anyways, was just if it could narrow it down.

JohnyWS avatar Nov 08 '19 23:11 JohnyWS

I see this a few times a day. Just looking at one now that has been running for 12minutes at 2.5% (on an 8 core machine). I fired up procmon, but there is no visible activity for the hanging process. I then looked at the threads in process explorer, there was only one, and it immediately woke up (which boggles my mind somewhat, correlation not causation (?)). I'm also seeing the createAppHost issue, which I can normally work my way thru by multiple incremental build swapping between Visual Studio and the command line (using dotnet build)

ddignam avatar Dec 05 '19 14:12 ddignam

We have somewhat same problem here. All stuff is done and paket.exe simply not returns. But there seems to be no activity.

I attached 2 screenshots here:

  • Console output of our build.cmd script (a simple batch file starting paket.exe restore) --> Screenshot1: ConsoleOutput.png
  • Sysinternals Process Monitor Screenshot of paket.exe process --> Screenshot2: ProcessMonitor.png

After the CloseFile() (Screenshot2) nothing happens, but paket.exe in our script not returns (Screenshot1).

Additional informations:

  • It doesn´t matter if paket.exe is started from cmd.exe, PowerShell, or the new Windows Terminal.
  • It doesn´t matter if paket.exe restore needs to restore or not (in Screenshot1 all packages were up2date).

Used environment:

  • Output of paket.exe --version: Paket version 7.2.1+8e4eb74b42fbd45f39f7afce9184c16ebb65f16c
  • Windows 11 Pro Version 22H2 Build 22621.1848
  • Visual Studio 2022 Version 17.6.3 (but doesn´t matter here)

We are a big company (but using my personal GitHub account here), developing and maintaining 1 giant .NET enterprise software product and we use paket.exe since years now. And this is a non-critical (but annoying) problem we have, since quite a while. The paket.exe does what it should (restore packages) and all is fine. The paket.exe simply not returns. We "fixed"it, by using a self-written tool, that scans for a paket.exe process and, if found, kills the process, so our script can continue then. But that´s more of a band aid patch than a solution. 😉

Any help is very appreciated!

Best regards

ConsoleOuput ProcessMonitor

mbodm avatar Jun 27 '23 15:06 mbodm

Nothing? Not some tip or any comment? 😞 Maybe it´s better when i open a new issue?

mbodm avatar Jul 03 '23 16:07 mbodm

🤖 This is an automated response from Repo Assist.

I looked into this thread and the code paths around process exit / restore completion (Program.fs, ProcessHelper.fs). I don't see an obvious root cause in current code — no lingering timers, unclosed file handles, or blocking waits after the final logged "CloseFile()" step described by reporters, and paket.exe's own main() does not spawn background threads or async work that could keep the process alive after handleCommand returns.

Given:

  • Reports span many years (2018–2023) and multiple unrelated environments (VS2017, VS2022, plain CLI), suggesting this is likely an OS/antivirus/file-handle-release quirk external to Paket itself (similar root cause pattern to the McAfee .locked file issue fixed in #3535/commit c0bcc69f1), rather than a single reproducible Paket bug.
  • No maintainer or reporter has isolated a specific stack/handle keeping the process alive.
  • The issue lacks a minimal, deterministic repro that a fix could target.

I don't have enough to implement a confident fix. If anyone can capture a stack trace/dump of a hung paket.exe process (e.g., via dotnet-dump or WinDbg) while it's stuck, that would let us pinpoint the blocking call. Otherwise, given the age and diffuse nature of these reports, this may be best tracked as needs investigation (already applied) pending a concrete repro.

Generated by 🌈 Repo Assist, see workflow run. Learn more. Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@ae8d551f07c7ed7619f8c58c7bb4c3ac89395d38

github-actions[bot] avatar Aug 29 '26 23:08 github-actions[bot]