isRefreshLockInaccessible reports whether err, returned while acquiring the refresh lock, shows that the lock file or its directory cannot be created or opened because the filesystem denies the write. That is the case when gh runs in a sandbox that makes its state directory read-only, which also pre
(err error)
| 69 | // the locking syscall itself (for example a filesystem without advisory locking) and lock contention timeouts are |
| 70 | // bare errors, so they are deliberately not classified as inaccessible. |
| 71 | func isRefreshLockInaccessible(err error) bool { |
| 72 | var pathErr *fs.PathError |
| 73 | if !errors.As(err, &pathErr) { |
| 74 | return false |
| 75 | } |
| 76 | return errors.Is(pathErr.Err, fs.ErrPermission) || errors.Is(pathErr.Err, syscall.EROFS) |
| 77 | } |
| 78 | |
| 79 | // withFreshConfigForRefresh runs fn, a credential-store read-modify-write (a token refresh, or a logout that must not |
| 80 | // race one), while holding both an in-process mutex and a cross-process advisory lock, and reloads the configuration |
no outgoing calls
no test coverage detected