Skip to content

v0.9.0.9000 trying to install private git remote saturates CPU #791

Open
@dgkf-roche

Description

@dgkf-roche

Perhaps I'm just catching the repo at a bad time, but because of the severity here I wanted to file this just in case it's not already on your radar.

Since the last release, recovery from a subprocess failing (specifically due to HTTP error when trying to read file tree from git remote) seems to be broken and now continues to spawn new processes until R is unable to allocate new sub processes, leaving all attempts running at 100% cpu usage in the background.

This breaks the R session - at least anything that attempts to spawn a new process like installing a package (with or without pak).

rm ~/.git-credentials
echo 'url=https://acme.org' | git credential reject
R -e 'pak::cache_delete()'

v0.9.0

Expected, subprocess fails and terminates, showing HTTP error suggesting there's a credentials issue

pak::pak("git::https://acme.org/team/pkg.git")
Error:
! ! error in pak subprocess
Caused by error: 
! Could not solve package dependencies:
*git::https://acme.org/team/pkg.git: ! pkgdepends resolution error for git::https://acme.org/team/pkg.git.
Caused by error: 
! Failed to download DESCRIPTION from git repo at
<https://acme.org/team/pkg.git>.
Caused by error in `stop(http_error(resp))`:
! Unauthorized (HTTP 401).
Hide Traceback
    ▆
 1. └─pak::pak("git::https://acme.org/team/pkg.git")
 2.   └─pak::pkg_install(pkg, ...)
 3.     └─pak:::remote(...)
 4.       └─err$throw(res$error)

v0.9.0.9000

pak::pak("git::https://acme.org/team/pkg.git")
Error in `remote()`:
! Subprocess is busy or cannot start
Hide Traceback
   ▆
 1. └─pak::pak("git::https://acme.org/team/pkg.git")
 2.   └─pak::pkg_install(pkg, ...)
 3.     └─pak:::remote(...)

note that before throwing the error, pak spawns as many processes as it can and they linger at 100% CPU usage. they persist after the error is thrown, bogging down the rest of the R session

$ top
PID    USER  PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                 
138221 dgkf  20   0 8531792  85952  15704 S 100.0   0.0   0:03.47 R                       
138430 dgkf  20   0 8531792  85532  15276 S 100.0   0.0   0:03.46 R                       
138290 dgkf  20   0 8531796  85752  15496 S 100.0   0.0   0:03.45 R                       
138504 dgkf  20   0 8531796  85860  15608 S 100.0   0.0   0:03.42 R                       
138361 dgkf  20   0 8531788  85884  15632 S 100.0   0.0   0:03.11 R                       
138576 dgkf  20   0 8978188  51932  14588 S 102.0   0.0   0:03.06 R                       
138144 dgkf  20   0 8531792  85656  15404 S  34.3   0.0   0:03.48 R                         

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