pkg sometimes hangs for nothing
Especially when searching for packages with pkg search -rp. Sometimes it just hangs there and doing nothing. Checked for network activity via VirtualBox, I found no network IO at all. A quick look via top also show no system resource being used other than what already there and there is no process named pkg! So this means it failed to run at all! I have to cancel it with Ctrl+C.
I don't have any knowledge about programming but I used to hear someone said it's the symptom of it failed to fork/exec itself, but please don't take my words seriously, since I really really don't know anything about programming at all!
And I found most of the time after a reboot I could search for packages with pkg search -rp again. It's weirded, I still have plenty of ram there!
Sometimes it's because network bottleneck and it's solved by tried again after some hours. I think if there is problem, pkg should let me know and exit peacefully instead of letting me to wait for nothing.
Updated by matt farnsworth 8 months ago
The program top is probably not well suited for your use case. Try ps -p $(pgrep pkg) or ps aux | grep pkg
I would suggest checking for network connectivity and sufficient bandwidth before starting pkg commands. pkg/client/transport/engine does have a feature to check if responses are "too slow" or stalled. (I have not checked if it works)
You can also add -v -v -v for more feedback from pkg