Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

juicefs - restic hangs #4257

Open
dubidubno opened this issue Mar 19, 2023 · 5 comments · May be fixed by #4267
Open

juicefs - restic hangs #4257

dubidubno opened this issue Mar 19, 2023 · 5 comments · May be fixed by #4267

Comments

@dubidubno
Copy link

Output of restic version

restic 0.15.1 compiled with go1.19.5 on linux/amd64

How did you run restic exactly?

Server: Debian 11, x86_64, VPS, 2 VCPU, 2 GB RAM, on Hetzner Cloud

export RESTIC_PASSWORD_FILE=/root/restic/password
export RESTIC_REPOSITORY_FILE=/root/restic/repository

/root/restic/bin/restic \
backup \
--verbose=2 \
--no-scan \
/mnt/my-juicefs-mount/

Output:

open repository
repository bf16cbdf opened (version 2, compression level auto)
lock repository
no parent snapshot found, will read all files
load index files
start backup on [/mnt/jfs-test/]
new       /mnt/jfs-test/.stats, saved in 0.003s (2.871 KiB added)
new       /mnt/jfs-test/.config, saved in 0.004s (0 B added)
new       /mnt/jfs-test/.trash/, saved in 0.001s (0 B added, 0 B stored, 0 B metadata)
[0:36] 2 files, 4.102 KiB, 0 errors
/mnt/jfs-test/.accesslog

What backend/server/service did you use to store the repository?

sftp, usb drive on a Raspberry Pi 3 Model B Rev 1.2

Expected behavior

Restic completes the backup with no error or with an error that the file .accesslog could not be backed up.

Actual behavior

Restic processes all but the last file on the filesystem, named .accesslog. Restic does not finish, just sits there for hours with the clock ticking.

Steps to reproduce the behavior

  1. create and mount an new juicefs filesystem (with MySQL as meta store and Linode S3 compatible object storage).
  2. run restric backup on the mounted filesystem.

Do you have any idea what may have caused this?

It has to do with accessing the .accesslog file.

A newly created juicefs filesystem contains these files by default:

root@he02:/mnt/jfs-test# ls -la
total 10
drwxrwxrwx 2 root root 4096 Mar 17 11:36 .
drwxr-xr-x 5 root root 4096 Mar 17 11:38 ..
-r-------- 1 root root    0 Mar 17 11:38 .accesslog
-r-------- 1 root root 1260 Mar 17 11:38 .config
-r--r--r-- 1 root root    0 Mar 17 11:38 .stats
dr-xr-xr-x 2 root root    0 Mar 17 11:38 .trash

If I exclude the file .accesslog, restic finishes with no errors, else it hangs after three files.

Juicefs has this to say about .accesslog:

Every JuiceFS mount point contains virtual files called .oplog (also aliased to .accesslog from 4.7.0 and above) and .ophistory. They are text files that contain realtime file system stats like operation type, UID/GID, inode, and operation duration.

(Troubleshooting Methods | JuiceFS Document Center 2)

Do you have an idea how to solve the issue?

No, but if I add --exclude '/mnt/*/.accesslog' restic finishes the backup successfully.

Did restic help you today? Did it make you happy in any way?

Restic smiled at me and made me feel good.

@rawtaz
Copy link
Contributor

rawtaz commented Mar 20, 2023

When it has hung, can you send a SIGABRT signal to the restic process and share the result here? The Go runtime will abort and print a stack trace of all running goroutines, which could help with debugging.

@greatroar
Copy link
Contributor

I just mounted juicefs and it looks like that file behaves like a FIFO, but has regular type as far as stat(2) is concerned. That means restic will open it and read it until it hits the end. But that file has no end, so the read never finishes.

Rsync has the same problem with a juicefs mount, see juicedata/juicefs#1859. The advice there is to just skip the file.

@rawtaz
Copy link
Contributor

rawtaz commented Mar 21, 2023

That makes sense. I was also wondering if that file is really needed, I guess it can have some value in being backed up, but it shouldn't be the main goal so to speak :)

@greatroar Would it in any way make sense to read such files in a way that just reads what is available at the time we read it, or can we not make that distinction at all so this isn't even an option?

@dubidubno
Copy link
Author

When it has hung, can you send a SIGABRT signal to the restic process and share the result here? The Go runtime will abort and print a stack trace of all running goroutines, which could help with debugging.

root@he02:~/restic# /root/restic/bin/restic backup /mnt/jfs-test/
repository bf16cbdf opened (version 2, compression level auto)
no parent snapshot found, will read all files
SIGABRT: abort 4.107 KiB, total 3 files 1.230 KiB, 0 errors
PC=0x44d1f9 m=8 sigcode=0

goroutine 10 [running]:
runtime.roundupsize(...)
        /usr/local/go/src/runtime/msize.go:16
runtime.growslice(0xc000090de8?, {0xc000090de0?, 0xc000090eaa?, 0xc000405520?}, 0xc000090f10?)
        /usr/local/go/src/runtime/slice.go:254 +0x2b9 fp=0xc000090da0 sp=0xc000090d38 pc=0x44d1f9
github.com/restic/restic/internal/ui/termstatus.(*Terminal).writeStatus(0xc000083980, {0xc0004521a0, 0x2, 0xc0051f7ca0?})
        /restic/internal/ui/termstatus/status.go:159 +0x6f fp=0xc000090e40 sp=0xc000090da0 pc=0x839fcf
github.com/restic/restic/internal/ui/termstatus.(*Terminal).run(0xc000083980, {0x12d7cd0, 0xc000424380})
        /restic/internal/ui/termstatus/status.go:152 +0x425 fp=0xc000090f50 sp=0xc000090e40 pc=0x839ee5
github.com/restic/restic/internal/ui/termstatus.(*Terminal).Run(0x0?, {0x12d7cd0?, 0xc000424380?})
        /restic/internal/ui/termstatus/status.go:93 +0x68 fp=0xc000090f98 sp=0xc000090f50 pc=0x8399e8
main.glob..func2.2()
        /restic/cmd/restic/cmd_backup.go:72 +0x65 fp=0xc000090fe0 sp=0xc000090f98 pc=0xe24ba5
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000090fe8 sp=0xc000090fe0 pc=0x466e21
created by main.glob..func2
        /restic/cmd/restic/cmd_backup.go:70 +0x1f3

goroutine 1 [semacquire]:
runtime.gopark(0xc0000061a0?, 0xc0003e0f78?, 0xc0?, 0x9?, 0x419ec6?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc0003e0ef8 sp=0xc0003e0ed8 pc=0x438876
runtime.goparkunlock(...)
        /usr/local/go/src/runtime/proc.go:369
runtime.semacquire1(0xc00009a590, 0x8e?, 0x1, 0x0)
        /usr/local/go/src/runtime/sema.go:150 +0x1fe fp=0xc0003e0f60 sp=0xc0003e0ef8 pc=0x448d9e
sync.runtime_Semacquire(0xc0000061a0?)
        /usr/local/go/src/runtime/sema.go:62 +0x25 fp=0xc0003e0f90 sp=0xc0003e0f60 pc=0x462e85
sync.(*WaitGroup).Wait(0xc00009a501?)
        /usr/local/go/src/sync/waitgroup.go:139 +0x52 fp=0xc0003e0fb8 sp=0xc0003e0f90 pc=0x4728b2
golang.org/x/sync/errgroup.(*Group).Wait(0xc00009a580)
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:53 +0x27 fp=0xc0003e0fd0 sp=0xc0003e0fb8 pc=0x74b147
github.com/restic/restic/internal/archiver.(*Archiver).Snapshot(0xc0001082d0, {0x12d7cd0?, 0xc000133200}, {0xc000406cd0, 0x1, 0x1}, {{0x1a0d8c0, 0x0, 0x0}, {0xc0003a8d8c, ...}, ...})
        /restic/internal/archiver/archiver.go:789 +0x393 fp=0xc0003e11a0 sp=0xc0003e0fd0 pc=0x7972f3
main.runBackup({_, _}, {{{0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...}, ...}, ...}, ...)
        /restic/cmd/restic/cmd_backup.go:639 +0x176b fp=0xc0003e18c0 sp=0xc0003e11a0 pc=0xe28b2b
main.glob..func2(0x19cbaa0?, {0xc000406c60, 0x1, 0x1})
        /restic/cmd/restic/cmd_backup.go:83 +0x528 fp=0xc0003e1c58 sp=0xc0003e18c0 pc=0xe24a08
github.com/spf13/cobra.(*Command).execute(0x19cbaa0, {0xc000406c20, 0x1, 0x1})
        /home/build/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916 +0x862 fp=0xc0003e1d90 sp=0xc0003e1c58 pc=0x73dfc2
github.com/spf13/cobra.(*Command).ExecuteC(0x19ca680)
        /home/build/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd fp=0xc0003e1e48 sp=0xc0003e1d90 pc=0x73e83d
github.com/spf13/cobra.(*Command).Execute(...)
        /home/build/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/spf13/cobra.(*Command).ExecuteContext(...)
        /home/build/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:961
main.main()
        /restic/cmd/restic/main.go:96 +0x19d fp=0xc0003e1f80 sp=0xc0003e1e48 pc=0xe6465d
runtime.main()
        /usr/local/go/src/runtime/proc.go:250 +0x212 fp=0xc0003e1fe0 sp=0xc0003e1f80 pc=0x4384b2
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0003e1fe8 sp=0xc0003e1fe0 pc=0x466e21

goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc000060fb0 sp=0xc000060f90 pc=0x438876
runtime.goparkunlock(...)
        /usr/local/go/src/runtime/proc.go:369
runtime.forcegchelper()
        /usr/local/go/src/runtime/proc.go:302 +0xad fp=0xc000060fe0 sp=0xc000060fb0 pc=0x43870d
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000060fe8 sp=0xc000060fe0 pc=0x466e21
created by runtime.init.6
        /usr/local/go/src/runtime/proc.go:290 +0x25

goroutine 3 [GC sweep wait]:
runtime.gopark(0x1?, 0x0?, 0x0?, 0x0?, 0x0?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc000061790 sp=0xc000061770 pc=0x438876
runtime.goparkunlock(...)
        /usr/local/go/src/runtime/proc.go:369
runtime.bgsweep(0x0?)
        /usr/local/go/src/runtime/mgcsweep.go:297 +0xd7 fp=0xc0000617c8 sp=0xc000061790 pc=0x424e97
runtime.gcenable.func1()
        /usr/local/go/src/runtime/mgc.go:178 +0x26 fp=0xc0000617e0 sp=0xc0000617c8 pc=0x419b06
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0000617e8 sp=0xc0000617e0 pc=0x466e21
created by runtime.gcenable
        /usr/local/go/src/runtime/mgc.go:178 +0x6b

goroutine 4 [GC scavenge wait]:
runtime.gopark(0x1ff66e4e330c2?, 0x117d334?, 0x0?, 0x0?, 0x0?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc000061f70 sp=0xc000061f50 pc=0x438876
runtime.goparkunlock(...)
        /usr/local/go/src/runtime/proc.go:369
runtime.(*scavengerState).park(0x19db980)
        /usr/local/go/src/runtime/mgcscavenge.go:389 +0x53 fp=0xc000061fa0 sp=0xc000061f70 pc=0x422ef3
runtime.bgscavenge(0x0?)
        /usr/local/go/src/runtime/mgcscavenge.go:622 +0x65 fp=0xc000061fc8 sp=0xc000061fa0 pc=0x4234e5
runtime.gcenable.func2()
        /usr/local/go/src/runtime/mgc.go:179 +0x26 fp=0xc000061fe0 sp=0xc000061fc8 pc=0x419aa6
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000061fe8 sp=0xc000061fe0 pc=0x466e21
created by runtime.gcenable
        /usr/local/go/src/runtime/mgc.go:179 +0xaa

goroutine 5 [finalizer wait]:
runtime.gopark(0x0?, 0xc000060670?, 0xab?, 0x6f?, 0xc000060770?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc000060628 sp=0xc000060608 pc=0x438876
runtime.goparkunlock(...)
        /usr/local/go/src/runtime/proc.go:369
runtime.runfinq()
        /usr/local/go/src/runtime/mfinal.go:180 +0x10f fp=0xc0000607e0 sp=0xc000060628 pc=0x418c0f
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0000607e8 sp=0xc0000607e0 pc=0x466e21
created by runtime.createfing
        /usr/local/go/src/runtime/mfinal.go:157 +0x45

goroutine 6 [chan receive]:
runtime.gopark(0xc000062690?, 0xc0000626e8?, 0xd1?, 0x5c?, 0xc0000626e8?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc0000626b8 sp=0xc000062698 pc=0x438876
runtime.chanrecv(0xc000100000, 0xc0000627a0, 0x1)
        /usr/local/go/src/runtime/chan.go:583 +0x49b fp=0xc000062748 sp=0xc0000626b8 pc=0x406cdb
runtime.chanrecv2(0xc000100000?, 0xc0000627c0?)
        /usr/local/go/src/runtime/chan.go:447 +0x18 fp=0xc000062770 sp=0xc000062748 pc=0x406818
github.com/restic/restic/internal/restic.init.0.func1.1()
        /restic/internal/restic/lock.go:297 +0x9d fp=0xc0000627e0 sp=0xc000062770 pc=0x77ba3d
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0000627e8 sp=0xc0000627e0 pc=0x466e21
created by github.com/restic/restic/internal/restic.init.0.func1
        /restic/internal/restic/lock.go:294 +0x25

goroutine 17 [select, locked to thread]:
runtime.gopark(0xc00005c7a8?, 0x2?, 0xf7?, 0x8b?, 0xc00005c7a4?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc00005c618 sp=0xc00005c5f8 pc=0x438876
runtime.selectgo(0xc00005c7a8, 0xc00005c7a0, 0x0?, 0x0, 0x0?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc00005c758 sp=0xc00005c618 pc=0x447cdc
runtime.ensureSigM.func1()
        /usr/local/go/src/runtime/signal_unix.go:991 +0x1b0 fp=0xc00005c7e0 sp=0xc00005c758 pc=0x44bfb0
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00005c7e8 sp=0xc00005c7e0 pc=0x466e21
created by runtime.ensureSigM
        /usr/local/go/src/runtime/signal_unix.go:974 +0xbd

goroutine 18 [syscall]:
runtime.notetsleepg(0x0?, 0x0?)
        /usr/local/go/src/runtime/lock_futex.go:236 +0x34 fp=0xc00005cfa0 sp=0xc00005cf68 pc=0x40c0d4
os/signal.signal_recv()
        /usr/local/go/src/runtime/sigqueue.go:152 +0x2f fp=0xc00005cfc0 sp=0xc00005cfa0 pc=0x4635ef
os/signal.loop()
        /usr/local/go/src/os/signal/signal_unix.go:23 +0x19 fp=0xc00005cfe0 sp=0xc00005cfc0 pc=0x4b60f9
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00005cfe8 sp=0xc00005cfe0 pc=0x466e21
created by os/signal.Notify.func1.1
        /usr/local/go/src/os/signal/signal.go:151 +0x2a

goroutine 20 [IO wait]:
runtime.gopark(0x417aeb?, 0xb?, 0x0?, 0x0?, 0xa?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc000062c90 sp=0xc000062c70 pc=0x438876
runtime.netpollblock(0x47ac05?, 0x49e1c5?, 0x0?)
        /usr/local/go/src/runtime/netpoll.go:526 +0xf7 fp=0xc000062cc8 sp=0xc000062c90 pc=0x4312f7
internal/poll.runtime_pollWait(0x7f1fb9bb8e98, 0x72)
        /usr/local/go/src/runtime/netpoll.go:305 +0x89 fp=0xc000062ce8 sp=0xc000062cc8 pc=0x4615c9
internal/poll.(*pollDesc).wait(0xc000083ce0?, 0xc0003a99d8?, 0x1)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x32 fp=0xc000062d10 sp=0xc000062ce8 pc=0x49e4d2
internal/poll.(*pollDesc).waitRead(...)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc000083ce0, {0xc0003a99d8, 0x4, 0x4})
        /usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a fp=0xc000062d90 sp=0xc000062d10 pc=0x49f83a
os.(*File).read(...)
        /usr/local/go/src/os/file_posix.go:31
os.(*File).Read(0xc000012d38, {0xc0003a99d8?, 0x7f1fe10365b8?, 0x406045?})
        /usr/local/go/src/os/file.go:119 +0x5e fp=0xc000062de8 sp=0xc000062d90 pc=0x4aafde
github.com/pkg/sftp.(*conn).Read(0x0?, {0xc0003a99d8?, 0xc000062e50?, 0x44ce32?})
        <autogenerated>:1 +0x2f fp=0xc000062e18 sp=0xc000062de8 pc=0xdac78f
io.ReadAtLeast({0x12ccfc0, 0xc0001a6cf0}, {0xc0003a99d8, 0x4, 0x4}, 0x4)
        /usr/local/go/src/io/io.go:332 +0x9a fp=0xc000062e60 sp=0xc000062e18 pc=0x498e3a
io.ReadFull(...)
        /usr/local/go/src/io/io.go:351
github.com/pkg/sftp.recvPacket({0x12ccfc0, 0xc0001a6cf0}, 0x0, 0x1dc401?)
        /home/build/go/pkg/mod/github.com/pkg/sftp@v1.13.5/packet.go:268 +0x96 fp=0xc000062ec0 sp=0xc000062e60 pc=0xda6936
github.com/pkg/sftp.(*conn).recvPacket(...)
        /home/build/go/pkg/mod/github.com/pkg/sftp@v1.13.5/conn.go:23
github.com/pkg/sftp.(*clientConn).recv(0xc0001a6cf0)
        /home/build/go/pkg/mod/github.com/pkg/sftp@v1.13.5/conn.go:78 +0xe5 fp=0xc000062f80 sp=0xc000062ec0 pc=0xda40a5
github.com/pkg/sftp.(*clientConn).loop(0xc0001a6cf0)
        /home/build/go/pkg/mod/github.com/pkg/sftp@v1.13.5/conn.go:66 +0x5f fp=0xc000062fc8 sp=0xc000062f80 pc=0xda3eff
github.com/pkg/sftp.NewClientPipe.func1()
        /home/build/go/pkg/mod/github.com/pkg/sftp@v1.13.5/client.go:237 +0x26 fp=0xc000062fe0 sp=0xc000062fc8 pc=0xd99b26
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000062fe8 sp=0xc000062fe0 pc=0x466e21
created by github.com/pkg/sftp.NewClientPipe
        /home/build/go/pkg/mod/github.com/pkg/sftp@v1.13.5/client.go:237 +0x278

goroutine 8 [select]:
runtime.gopark(0xc000063788?, 0x3?, 0x58?, 0x60?, 0xc000063772?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc0000635f8 sp=0xc0000635d8 pc=0x438876
runtime.selectgo(0xc000063788, 0xc00006376c, 0xc00034ad00?, 0x0, 0x0?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc000063738 sp=0xc0000635f8 pc=0x447cdc
go.opencensus.io/stats/view.(*worker).start(0xc00034ad00)
        /home/build/go/pkg/mod/go.opencensus.io@v0.24.0/stats/view/worker.go:292 +0xad fp=0xc0000637c8 sp=0xc000063738 pc=0xc7bd2d
go.opencensus.io/stats/view.init.0.func1()
        /home/build/go/pkg/mod/go.opencensus.io@v0.24.0/stats/view/worker.go:34 +0x26 fp=0xc0000637e0 sp=0xc0000637c8 pc=0xc7af66
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0000637e8 sp=0xc0000637e0 pc=0x466e21
created by go.opencensus.io/stats/view.init.0
        /home/build/go/pkg/mod/go.opencensus.io@v0.24.0/stats/view/worker.go:34 +0x8d

goroutine 19 [chan receive]:
runtime.gopark(0xc00008e778?, 0xc0004041a0?, 0x28?, 0x42?, 0xc0004042e8?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc000063e80 sp=0xc000063e60 pc=0x438876
runtime.chanrecv(0xc000100780, 0xc000063f78, 0x1)
        /usr/local/go/src/runtime/chan.go:583 +0x49b fp=0xc000063f10 sp=0xc000063e80 pc=0x406cdb
runtime.chanrecv2(0x114da06?, 0x0?)
        /usr/local/go/src/runtime/chan.go:447 +0x18 fp=0xc000063f38 sp=0xc000063f10 pc=0x406818
main.CleanupHandler(0xc0001a6b40?)
        /restic/cmd/restic/cleanup.go:61 +0x47 fp=0xc000063fc8 sp=0xc000063f38 pc=0xe242a7
main.init.0.func1()
        /restic/cmd/restic/cleanup.go:21 +0x26 fp=0xc000063fe0 sp=0xc000063fc8 pc=0xe23e06
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000063fe8 sp=0xc000063fe0 pc=0x466e21
created by main.init.0
        /restic/cmd/restic/cleanup.go:21 +0x8b

goroutine 11 [IO wait]:
runtime.gopark(0x0?, 0xb?, 0x0?, 0x0?, 0x6?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc00044eca0 sp=0xc00044ec80 pc=0x438876
runtime.netpollblock(0x47ac05?, 0x0?, 0x0?)
        /usr/local/go/src/runtime/netpoll.go:526 +0xf7 fp=0xc00044ecd8 sp=0xc00044eca0 pc=0x4312f7
internal/poll.runtime_pollWait(0x7f1fb9bb9258, 0x72)
        /usr/local/go/src/runtime/netpoll.go:305 +0x89 fp=0xc00044ecf8 sp=0xc00044ecd8 pc=0x4615c9
internal/poll.(*pollDesc).wait(0xc000083b60?, 0xc0004f4000?, 0x1)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x32 fp=0xc00044ed20 sp=0xc00044ecf8 pc=0x49e4d2
internal/poll.(*pollDesc).waitRead(...)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Read(0xc000083b60, {0xc0004f4000, 0x1000, 0x1000})
        /usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a fp=0xc00044eda0 sp=0xc00044ed20 pc=0x49f83a
os.(*File).read(...)
        /usr/local/go/src/os/file_posix.go:31
os.(*File).Read(0xc000012d18, {0xc0004f4000?, 0x0?, 0x0?})
        /usr/local/go/src/os/file.go:119 +0x5e fp=0xc00044edf8 sp=0xc00044eda0 pc=0x4aafde
bufio.(*Scanner).Scan(0xc00044ef50)
        /usr/local/go/src/bufio/scan.go:214 +0x876 fp=0xc00044eed0 sp=0xc00044edf8 pc=0x669af6
github.com/restic/restic/internal/backend/sftp.startClient.func1()
        /restic/internal/backend/sftp/sftp.go:67 +0x152 fp=0xc00044efe0 sp=0xc00044eed0 pc=0xdaf032
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00044efe8 sp=0xc00044efe0 pc=0x466e21
created by github.com/restic/restic/internal/backend/sftp.startClient
        /restic/internal/backend/sftp/sftp.go:65 +0x1e5

goroutine 12 [syscall]:
syscall.Syscall6(0x0?, 0x0?, 0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        /usr/local/go/src/syscall/syscall_linux.go:90 +0x36 fp=0xc00044f5c0 sp=0xc00044f538 pc=0x47cd56
os.(*Process).blockUntilWaitable(0xc000044b70)
        /usr/local/go/src/os/wait_waitid.go:32 +0x87 fp=0xc00044f698 sp=0xc00044f5c0 pc=0x4b2207
os.(*Process).wait(0xc000044b70)
        /usr/local/go/src/os/exec_unix.go:22 +0x28 fp=0xc00044f6f8 sp=0xc00044f698 pc=0x4aa7c8
os.(*Process).Wait(...)
        /usr/local/go/src/os/exec.go:132
os/exec.(*Cmd).Wait(0xc0000d1ce0)
        /usr/local/go/src/os/exec/exec.go:599 +0x4b fp=0xc00044f770 sp=0xc00044f6f8 pc=0x7a15eb
github.com/restic/restic/internal/backend/sftp.startClient.func2()
        /restic/internal/backend/sftp/sftp.go:93 +0x2a fp=0xc00044f7e0 sp=0xc00044f770 pc=0xdaee4a
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00044f7e8 sp=0xc00044f7e0 pc=0x466e21
created by github.com/restic/restic/internal/backend/sftp.startClient
        /restic/internal/backend/sftp/sftp.go:92 +0x3c5

goroutine 13 [GC worker (idle)]:
runtime.gopark(0x1ff66f46bf20d?, 0x0?, 0x0?, 0x0?, 0x0?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc00044ff50 sp=0xc00044ff30 pc=0x438876
runtime.gcBgMarkWorker()
        /usr/local/go/src/runtime/mgc.go:1235 +0xf1 fp=0xc00044ffe0 sp=0xc00044ff50 pc=0x41bc51
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00044ffe8 sp=0xc00044ffe0 pc=0x466e21
created by runtime.gcBgMarkStartWorkers
        /usr/local/go/src/runtime/mgc.go:1159 +0x25

goroutine 21 [GC worker (idle)]:
runtime.gopark(0x1ff66f46befaa?, 0x12d7cd0?, 0x80?, 0x43?, 0x100000000000000?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc00044e750 sp=0xc00044e730 pc=0x438876
runtime.gcBgMarkWorker()
        /usr/local/go/src/runtime/mgc.go:1235 +0xf1 fp=0xc00044e7e0 sp=0xc00044e750 pc=0x41bc51
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00044e7e8 sp=0xc00044e7e0 pc=0x466e21
created by runtime.gcBgMarkStartWorkers
        /usr/local/go/src/runtime/mgc.go:1159 +0x25

goroutine 22 [runnable]:
github.com/restic/restic/internal/ui/backup.NewProgress.func1.1()
        /restic/internal/ui/backup/progress.go:69 +0x35 fp=0xc000255e18 sp=0xc000255e10 pc=0x83db95
github.com/restic/restic/internal/ui/backup.NewProgress.func1(0xc0fe82e7aa396cd9?, 0xe6?)
        /restic/internal/ui/backup/progress.go:83 +0x265 fp=0xc000255ed0 sp=0xc000255e18 pc=0x83db05
github.com/restic/restic/internal/ui/progress.(*Updater).run(0xc0004242c0)
        /restic/internal/ui/progress/updater.go:82 +0xe4 fp=0xc000255fc8 sp=0xc000255ed0 pc=0x768f24
github.com/restic/restic/internal/ui/progress.NewUpdater.func1()
        /restic/internal/ui/progress/updater.go:40 +0x26 fp=0xc000255fe0 sp=0xc000255fc8 pc=0x768d46
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000255fe8 sp=0xc000255fe0 pc=0x466e21
created by github.com/restic/restic/internal/ui/progress.NewUpdater
        /restic/internal/ui/progress/updater.go:40 +0x16d

goroutine 36 [select]:
runtime.gopark(0xc00005d750?, 0x2?, 0x0?, 0x30?, 0xc00005d704?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc00005d560 sp=0xc00005d540 pc=0x438876
runtime.selectgo(0xc00005d750, 0xc00005d700, 0x0?, 0x0, 0xc5caa1c1703b46f5?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc00005d6a0 sp=0xc00005d560 pc=0x447cdc
main.refreshLocks({0x12d7cd0, 0xc000133200}, 0xc0003dc770, 0xc000010c00, 0xc00010a240)
        /restic/cmd/restic/lock.go:98 +0x170 fp=0xc00005d7a8 sp=0xc00005d6a0 pc=0xe635f0
main.lockRepository.func2()
        /restic/cmd/restic/lock.go:64 +0x36 fp=0xc00005d7e0 sp=0xc00005d7a8 pc=0xe63456
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00005d7e8 sp=0xc00005d7e0 pc=0x466e21
created by main.lockRepository
        /restic/cmd/restic/lock.go:64 +0x3bb

goroutine 37 [select]:
runtime.gopark(0xc00005ef60?, 0x3?, 0x0?, 0x30?, 0xc00005eef2?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc00005ed58 sp=0xc00005ed38 pc=0x438876
runtime.selectgo(0xc00005ef60, 0xc00005eeec, 0x781550?, 0x0, 0x49e9bcb64c65b131?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc00005ee98 sp=0xc00005ed58 pc=0x447cdc
main.monitorLockRefresh({0x12d7cd0, 0xc000133200}, 0x0?, 0xc000010c00, 0xc00010a240)
        /restic/cmd/restic/lock.go:144 +0x1f1 fp=0xc00005efa8 sp=0xc00005ee98 pc=0xe63b51
main.lockRepository.func3()
        /restic/cmd/restic/lock.go:65 +0x36 fp=0xc00005efe0 sp=0xc00005efa8 pc=0xe633f6
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00005efe8 sp=0xc00005efe0 pc=0x466e21
created by main.lockRepository
        /restic/cmd/restic/lock.go:65 +0x44a

goroutine 58 [semacquire]:
runtime.gopark(0x19d9468?, 0xc000451680?, 0x0?, 0xa0?, 0xc0004516c0?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc000451688 sp=0xc000451668 pc=0x438876
runtime.goparkunlock(...)
        /usr/local/go/src/runtime/proc.go:369
runtime.semacquire1(0xc00009a610, 0x0?, 0x1, 0x0)
        /usr/local/go/src/runtime/sema.go:150 +0x1fe fp=0xc0004516f0 sp=0xc000451688 pc=0x448d9e
sync.runtime_Semacquire(0x0?)
        /usr/local/go/src/runtime/sema.go:62 +0x25 fp=0xc000451720 sp=0xc0004516f0 pc=0x462e85
sync.(*WaitGroup).Wait(0xc00008eba0?)
        /usr/local/go/src/sync/waitgroup.go:139 +0x52 fp=0xc000451748 sp=0xc000451720 pc=0x4728b2
golang.org/x/sync/errgroup.(*Group).Wait(0xc00009a600)
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:53 +0x27 fp=0xc000451760 sp=0xc000451748 pc=0x74b147
github.com/restic/restic/internal/repository.(*Repository).StartPackUploader.func1()
        /restic/internal/repository/repository.go:536 +0x1d fp=0xc000451778 sp=0xc000451760 pc=0x82e0fd
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc0004517e0 sp=0xc000451778 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0004517e8 sp=0xc0004517e0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 55 [select]:
runtime.gopark(0xc00044df48?, 0x2?, 0x0?, 0xec?, 0xc00044df14?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc00044dd90 sp=0xc00044dd70 pc=0x438876
runtime.selectgo(0xc00044df48, 0xc00044df10, 0x0?, 0x0, 0x938bca5da34534fd?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc00044ded0 sp=0xc00044dd90 pc=0x447cdc
github.com/restic/restic/internal/repository.newPackerUploader.func1()
        /restic/internal/repository/packer_uploader.go:32 +0xce fp=0xc00044df78 sp=0xc00044ded0 pc=0x828c6e
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc00044dfe0 sp=0xc00044df78 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00044dfe8 sp=0xc00044dfe0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 57 [select]:
runtime.gopark(0xc00044bf48?, 0x2?, 0x40?, 0x2c?, 0xc00044bf14?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc00044bd90 sp=0xc00044bd70 pc=0x438876
runtime.selectgo(0xc00044bf48, 0xc00044bf10, 0x89?, 0x0, 0x1bf1a0fa820ed29d?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc00044bed0 sp=0xc00044bd90 pc=0x447cdc
github.com/restic/restic/internal/repository.newPackerUploader.func1()
        /restic/internal/repository/packer_uploader.go:32 +0xce fp=0xc00044bf78 sp=0xc00044bed0 pc=0x828c6e
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc00044bfe0 sp=0xc00044bf78 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00044bfe8 sp=0xc00044bfe0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 54 [select]:
runtime.gopark(0xc00044c748?, 0x2?, 0x1?, 0x0?, 0xc00044c714?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc00044c590 sp=0xc00044c570 pc=0x438876
runtime.selectgo(0xc00044c748, 0xc00044c710, 0x7816ab?, 0x0, 0x12d7cd0?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc00044c6d0 sp=0xc00044c590 pc=0x447cdc
github.com/restic/restic/internal/repository.newPackerUploader.func1()
        /restic/internal/repository/packer_uploader.go:32 +0xce fp=0xc00044c778 sp=0xc00044c6d0 pc=0x828c6e
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc00044c7e0 sp=0xc00044c778 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00044c7e8 sp=0xc00044c7e0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 56 [select]:
runtime.gopark(0xc00044b748?, 0x2?, 0x40?, 0x2c?, 0xc00044b714?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc00044b590 sp=0xc00044b570 pc=0x438876
runtime.selectgo(0xc00044b748, 0xc00044b710, 0x87?, 0x0, 0xe8b73d24f4cc21b2?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc00044b6d0 sp=0xc00044b590 pc=0x447cdc
github.com/restic/restic/internal/repository.newPackerUploader.func1()
        /restic/internal/repository/packer_uploader.go:32 +0xce fp=0xc00044b778 sp=0xc00044b6d0 pc=0x828c6e
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc00044b7e0 sp=0xc00044b778 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00044b7e8 sp=0xc00044b7e0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 53 [select]:
runtime.gopark(0xc000450748?, 0x2?, 0x11?, 0x58?, 0xc000450714?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc000450590 sp=0xc000450570 pc=0x438876
runtime.selectgo(0xc000450748, 0xc000450710, 0x0?, 0x0, 0x95e96a7c511c6572?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc0004506d0 sp=0xc000450590 pc=0x447cdc
github.com/restic/restic/internal/repository.newPackerUploader.func1()
        /restic/internal/repository/packer_uploader.go:32 +0xce fp=0xc000450778 sp=0xc0004506d0 pc=0x828c6e
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc0004507e0 sp=0xc000450778 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0004507e8 sp=0xc0004507e0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 59 [semacquire]:
runtime.gopark(0xc00044ce20?, 0xc00044ce60?, 0x60?, 0x23?, 0xc0001083e8?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc00044cde0 sp=0xc00044cdc0 pc=0x438876
runtime.goparkunlock(...)
        /usr/local/go/src/runtime/proc.go:369
runtime.semacquire1(0xc00009a690, 0x8e?, 0x1, 0x0)
        /usr/local/go/src/runtime/sema.go:150 +0x1fe fp=0xc00044ce48 sp=0xc00044cde0 pc=0x448d9e
sync.runtime_Semacquire(0xc000384820?)
        /usr/local/go/src/runtime/sema.go:62 +0x25 fp=0xc00044ce78 sp=0xc00044ce48 pc=0x462e85
sync.(*WaitGroup).Wait(0x488b01?)
        /usr/local/go/src/sync/waitgroup.go:139 +0x52 fp=0xc00044cea0 sp=0xc00044ce78 pc=0x4728b2
golang.org/x/sync/errgroup.(*Group).Wait(0xc00009a680)
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:53 +0x27 fp=0xc00044ceb8 sp=0xc00044cea0 pc=0x74b147
github.com/restic/restic/internal/archiver.(*Archiver).Snapshot.func1()
        /restic/internal/archiver/archiver.go:779 +0x245 fp=0xc00044cf78 sp=0xc00044ceb8 pc=0x797965
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc00044cfe0 sp=0xc00044cf78 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00044cfe8 sp=0xc00044cfe0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 60 [select]:
runtime.gopark(0xc001f07d18?, 0x2?, 0xe0?, 0x7c?, 0xc001f07d0c?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc001f07b98 sp=0xc001f07b78 pc=0x438876
runtime.selectgo(0xc001f07d18, 0xc001f07d08, 0x7f1fe1036108?, 0x0, 0xc000332570?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc001f07cd8 sp=0xc001f07b98 pc=0x447cdc
github.com/restic/restic/internal/archiver.(*FutureNode).take(0xc001f07ef0, {0x12d7cd0?, 0xc00009a640?})
        /restic/internal/archiver/archiver.go:303 +0x16a fp=0xc001f07e18 sp=0xc001f07cd8 pc=0x79332a
github.com/restic/restic/internal/archiver.(*Archiver).Snapshot.func1.1()
        /restic/internal/archiver/archiver.go:761 +0x1ee fp=0xc001f07f78 sp=0xc001f07e18 pc=0x797c8e
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc001f07fe0 sp=0xc001f07f78 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc001f07fe8 sp=0xc001f07fe0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 61 [select]:
runtime.gopark(0xc00024ff18?, 0x2?, 0x90?, 0xfd?, 0xc00024fe54?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc00024fc98 sp=0xc00024fc78 pc=0x438876
runtime.selectgo(0xc00024ff18, 0xc00024fe50, 0xa3780574acb9ff28?, 0x0, 0xd?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc00024fdd8 sp=0xc00024fc98 pc=0x447cdc
github.com/restic/restic/internal/archiver.(*BlobSaver).worker(0xc00009ae80?, {0x12d7cd0, 0xc00009a640}, 0xc0089f8480)
        /restic/internal/archiver/blob_saver.go:86 +0xd0 fp=0xc00024ff48 sp=0xc00024fdd8 pc=0x798550
github.com/restic/restic/internal/archiver.NewBlobSaver.func1()
        /restic/internal/archiver/blob_saver.go:33 +0x29 fp=0xc00024ff78 sp=0xc00024ff48 pc=0x798169
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc00024ffe0 sp=0xc00024ff78 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00024ffe8 sp=0xc00024ffe0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 62 [select]:
runtime.gopark(0xc001f03f18?, 0x2?, 0x0?, 0x0?, 0xc001f03e54?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc001f03c98 sp=0xc001f03c78 pc=0x438876
runtime.selectgo(0xc001f03f18, 0xc001f03e50, 0x4bacb9ff5e9f541b?, 0x0, 0xb82?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc001f03dd8 sp=0xc001f03c98 pc=0x447cdc
github.com/restic/restic/internal/archiver.(*BlobSaver).worker(0xc000424340?, {0x12d7cd0, 0xc00009a640}, 0xc0089f8480)
        /restic/internal/archiver/blob_saver.go:86 +0xd0 fp=0xc001f03f48 sp=0xc001f03dd8 pc=0x798550
github.com/restic/restic/internal/archiver.NewBlobSaver.func1()
        /restic/internal/archiver/blob_saver.go:33 +0x29 fp=0xc001f03f78 sp=0xc001f03f48 pc=0x798169
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc001f03fe0 sp=0xc001f03f78 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc001f03fe8 sp=0xc001f03fe0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 63 [syscall]:
syscall.Syscall(0x49e1c5?, 0x0?, 0x49e392?, 0x7ffff800000?)
        /usr/local/go/src/syscall/syscall_linux.go:68 +0x27 fp=0xc0003e58d8 sp=0xc0003e5868 pc=0x47ccc7
syscall.read(0xc0000839e0?, {0xc008a109bf?, 0x1?, 0x0?})
        /usr/local/go/src/syscall/zsyscall_linux_amd64.go:696 +0x45 fp=0xc0003e5918 sp=0xc0003e58d8 pc=0x47ac05
syscall.Read(...)
        /usr/local/go/src/syscall/syscall_unix.go:183
internal/poll.ignoringEINTRIO(...)
        /usr/local/go/src/internal/poll/fd_unix.go:794
internal/poll.(*FD).Read(0xc0000839e0?, {0xc008a109bf?, 0x7f641?, 0x7f641?})
        /usr/local/go/src/internal/poll/fd_unix.go:163 +0x285 fp=0xc0003e5998 sp=0xc0003e5918 pc=0x49f865
os.(*File).read(...)
        /usr/local/go/src/os/file_posix.go:31
os.(*File).Read(0xc000130490, {0xc008a109bf?, 0x7f6ea?, 0x7f6ea?})
        /usr/local/go/src/os/file.go:119 +0x5e fp=0xc0003e59f0 sp=0xc0003e5998 pc=0x4aafde
io.ReadAtLeast({0x12cfa40, 0xc000130490}, {0xc008a10000, 0x80000, 0x80000}, 0x80000)
        /usr/local/go/src/io/io.go:332 +0x9a fp=0xc0003e5a38 sp=0xc0003e59f0 pc=0x498e3a
io.ReadFull(...)
        /usr/local/go/src/io/io.go:351
github.com/restic/chunker.(*Chunker).Next(0xc0000f1300, {0xc008a90000?, 0xc000130490?, 0xc0003e5e70?})
        /home/build/go/pkg/mod/github.com/restic/chunker@v0.4.0/chunker.go:238 +0x1ed fp=0xc0003e5be0 sp=0xc0003e5a38 pc=0x76696d
github.com/restic/restic/internal/archiver.(*FileSaver).saveFile(0xc000332420, {0x12d7cd0, 0xc00009a640}, 0x12e0d78?, {0xc000046720, 0x18}, {0xc0000466f0, 0x18}, {0x12dc390, 0xc000130490}, ...)
        /restic/internal/archiver/file_saver.go:179 +0x5f9 fp=0xc0003e5d60 sp=0xc0003e5be0 pc=0x7993f9
github.com/restic/restic/internal/archiver.(*FileSaver).worker(0xc000332420, {0x12d7cd0, 0xc00009a640}, 0xc0089f84e0)
        /restic/internal/archiver/file_saver.go:264 +0x105 fp=0xc0003e5f48 sp=0xc0003e5d60 pc=0x79a165
github.com/restic/restic/internal/archiver.NewFileSaver.func2()
        /restic/internal/archiver/file_saver.go:54 +0x29 fp=0xc0003e5f78 sp=0xc0003e5f48 pc=0x798ae9
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc0003e5fe0 sp=0xc0003e5f78 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0003e5fe8 sp=0xc0003e5fe0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 64 [select]:
runtime.gopark(0xc0051c1df0?, 0x2?, 0x0?, 0x0?, 0xc0051c1ddc?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc0051c1c20 sp=0xc0051c1c00 pc=0x438876
runtime.selectgo(0xc0051c1df0, 0xc0051c1dd8, 0x12da7a0?, 0x0, 0xc0051c1ed0?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc0051c1d60 sp=0xc0051c1c20 pc=0x447cdc
github.com/restic/restic/internal/archiver.(*FileSaver).worker(0xc000332420, {0x12d7cd0, 0xc00009a640}, 0xc0089f84e0)
        /restic/internal/archiver/file_saver.go:255 +0x1ce fp=0xc0051c1f48 sp=0xc0051c1d60 pc=0x79a22e
github.com/restic/restic/internal/archiver.NewFileSaver.func2()
        /restic/internal/archiver/file_saver.go:54 +0x29 fp=0xc0051c1f78 sp=0xc0051c1f48 pc=0x798ae9
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc0051c1fe0 sp=0xc0051c1f78 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0051c1fe8 sp=0xc0051c1fe0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 65 [select]:
runtime.gopark(0xc008a0e588?, 0x2?, 0x0?, 0x0?, 0xc008a0e57c?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc008a0e408 sp=0xc008a0e3e8 pc=0x438876
runtime.selectgo(0xc008a0e588, 0xc008a0e578, 0x0?, 0x0, 0x0?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc008a0e548 sp=0xc008a0e408 pc=0x447cdc
github.com/restic/restic/internal/archiver.(*FutureNode).take(0xc008a0e9e0, {0x12d7cd0?, 0xc00009a640?})
        /restic/internal/archiver/archiver.go:303 +0x16a fp=0xc008a0e688 sp=0xc008a0e548 pc=0x79332a
github.com/restic/restic/internal/archiver.(*TreeSaver).save(0xc0067712d8, {0x12d7cd0, 0xc00009a640}, 0xc008a0ee30?)
        /restic/internal/archiver/tree_saver.go:88 +0x58e fp=0xc008a0ed40 sp=0xc008a0e688 pc=0x79e46e
github.com/restic/restic/internal/archiver.(*TreeSaver).worker(0x0?, {0x12d7cd0, 0xc00009a640}, 0xc0089f8540)
        /restic/internal/archiver/tree_saver.go:160 +0x225 fp=0xc008a0ef48 sp=0xc008a0ed40 pc=0x79ec25
github.com/restic/restic/internal/archiver.NewTreeSaver.func1()
        /restic/internal/archiver/tree_saver.go:33 +0x29 fp=0xc008a0ef78 sp=0xc008a0ef48 pc=0x79dc49
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc008a0efe0 sp=0xc008a0ef78 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc008a0efe8 sp=0xc008a0efe0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 66 [select]:
runtime.gopark(0xc000097588?, 0x2?, 0x0?, 0x0?, 0xc00009757c?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc000097408 sp=0xc0000973e8 pc=0x438876
runtime.selectgo(0xc000097588, 0xc000097578, 0x0?, 0x0, 0x0?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc000097548 sp=0xc000097408 pc=0x447cdc
github.com/restic/restic/internal/archiver.(*FutureNode).take(0xc0000979e0, {0x12d7cd0?, 0xc00009a640?})
        /restic/internal/archiver/archiver.go:303 +0x16a fp=0xc000097688 sp=0xc000097548 pc=0x79332a
github.com/restic/restic/internal/archiver.(*TreeSaver).save(0xc0067712d8, {0x12d7cd0, 0xc00009a640}, 0x0?)
        /restic/internal/archiver/tree_saver.go:88 +0x58e fp=0xc000097d40 sp=0xc000097688 pc=0x79e46e
github.com/restic/restic/internal/archiver.(*TreeSaver).worker(0x0?, {0x12d7cd0, 0xc00009a640}, 0xc0089f8540)
        /restic/internal/archiver/tree_saver.go:160 +0x225 fp=0xc000097f48 sp=0xc000097d40 pc=0x79ec25
github.com/restic/restic/internal/archiver.NewTreeSaver.func1()
        /restic/internal/archiver/tree_saver.go:33 +0x29 fp=0xc000097f78 sp=0xc000097f48 pc=0x79dc49
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc000097fe0 sp=0xc000097f78 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000097fe8 sp=0xc000097fe0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 67 [select]:
runtime.gopark(0xc000096588?, 0x2?, 0x0?, 0x0?, 0xc00009657c?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc000096408 sp=0xc0000963e8 pc=0x438876
runtime.selectgo(0xc000096588, 0xc000096578, 0x0?, 0x0, 0x0?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc000096548 sp=0xc000096408 pc=0x447cdc
github.com/restic/restic/internal/archiver.(*FutureNode).take(0xc0000969e0, {0x12d7cd0?, 0xc00009a640?})
        /restic/internal/archiver/archiver.go:303 +0x16a fp=0xc000096688 sp=0xc000096548 pc=0x79332a
github.com/restic/restic/internal/archiver.(*TreeSaver).save(0xc0067712d8, {0x12d7cd0, 0xc00009a640}, 0x0?)
        /restic/internal/archiver/tree_saver.go:88 +0x58e fp=0xc000096d40 sp=0xc000096688 pc=0x79e46e
github.com/restic/restic/internal/archiver.(*TreeSaver).worker(0xc00009ae80?, {0x12d7cd0, 0xc00009a640}, 0xc0089f8540)
        /restic/internal/archiver/tree_saver.go:160 +0x225 fp=0xc000096f48 sp=0xc000096d40 pc=0x79ec25
github.com/restic/restic/internal/archiver.NewTreeSaver.func1()
        /restic/internal/archiver/tree_saver.go:33 +0x29 fp=0xc000096f78 sp=0xc000096f48 pc=0x79dc49
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc000096fe0 sp=0xc000096f78 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000096fe8 sp=0xc000096fe0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

goroutine 68 [select]:
runtime.gopark(0xc001f05e10?, 0x2?, 0x1?, 0x0?, 0xc001f05d84?)
        /usr/local/go/src/runtime/proc.go:363 +0xd6 fp=0xc001f05c00 sp=0xc001f05be0 pc=0x438876
runtime.selectgo(0xc001f05e10, 0xc001f05d80, 0x0?, 0x0, 0x0?, 0x1)
        /usr/local/go/src/runtime/select.go:328 +0x7bc fp=0xc001f05d40 sp=0xc001f05c00 pc=0x447cdc
github.com/restic/restic/internal/archiver.(*TreeSaver).worker(0x0?, {0x12d7cd0, 0xc00009a640}, 0xc0089f8540)
        /restic/internal/archiver/tree_saver.go:151 +0x1b9 fp=0xc001f05f48 sp=0xc001f05d40 pc=0x79ebb9
github.com/restic/restic/internal/archiver.NewTreeSaver.func1()
        /restic/internal/archiver/tree_saver.go:33 +0x29 fp=0xc001f05f78 sp=0xc001f05f48 pc=0x79dc49
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64 fp=0xc001f05fe0 sp=0xc001f05f78 pc=0x74b2e4
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc001f05fe8 sp=0xc001f05fe0 pc=0x466e21
created by golang.org/x/sync/errgroup.(*Group).Go
        /home/build/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5

rax    0xf104a0
rbx    0xc000090de0
rcx    0x4
rdx    0x4
rdi    0x20
rsi    0x4
rbp    0xc000090d90
rsp    0xc000090d38
r8     0x0
r9     0x0
r10    0x2
r11    0x195df00
r12    0xc000090e20
r13    0xffffffffffffffff
r14    0xc000405520
r15    0x0
rip    0x44d1f9
rflags 0x283
cs     0x33
fs     0x0
gs     0x0
root@he02:~/restic#

@greatroar
Copy link
Contributor

greatroar commented Mar 21, 2023

The crash dumps confirms my suspicion: goroutine 63 is blocked reading from the target directory.

@rawtaz:

Would it in any way make sense to read such files in a way that just reads what is available at the time we read it, or can we not make that distinction at all so this isn't even an option?

I don't think we can make that distinction. What we can do is not even try to read files whose size is advertised as zero. That would even be a general-purpose optimization, as we don't need to initialize the chunker for them and such files are produced by Git, the Go module cache and some other programs. A better fix for juicefs, though, would be that they make this file a FIFO instead of a regular file.

greatroar added a commit to greatroar/restic that referenced this issue Mar 23, 2023
Regular files that are empty according to stat are now not opened for
reading their contents. Such files are quite common (in my homedir, at
least) and we can save multiple system calls this way. On a network
filesystem, that can mean round trips. Also, we can back up empty files
that we cannot open for reading. Finally, fixes restic#4257.

Existing tests cover this case. fs.Reader now no longer has a meaningful
Size. Nothing depended on that.
@greatroar greatroar linked a pull request Mar 23, 2023 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants