fix(189pc): crashes when upload cancelled #9094
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will fix this:
panic: semaphore: released more than held
goroutine 46665 [running]:
golang.org/x/sync/semaphore.(*Weighted).Release(0xc000598550, 0xc0018a6000?)
/home/runner/go/pkg/mod/golang.org/x/sync@v0.12.0/semaphore/semaphore.go:127 +0xb8
github.com/alist-org/alist/v3/drivers/189pc.(*Cloud189PC).StreamUpload.func2({0x3f39ae8, 0xc0005984b0})
/home/runner/work/alist/alist/drivers/189pc/utils.go:547 +0x418
github.com/alist-org/alist/v3/pkg/errgroup.(*Group).Go.func1.1()
/home/runner/work/alist/alist/pkg/errgroup/errgroup.go:50 +0x23
github.com/avast/retry-go.Do(0xc000dc1fb0, {0xc000bf8bd0, 0x4, 0x771516?})
/home/runner/go/pkg/mod/github.com/avast/retry-go@v3.0.0+incompatible/retry.go:127 +0x1c3
github.com/alist-org/alist/v3/pkg/errgroup.(*Group).Go.func1()
/home/runner/work/alist/alist/pkg/errgroup/errgroup.go:50 +0x77
created by github.com/alist-org/alist/v3/pkg/errgroup.(*Group).Go in goroutine 45326
/home/runner/work/alist/alist/pkg/errgroup/errgroup.go:48 +0x96