ostree/src
Colin Walters 5c4f26bd65 lib/pull: Wait for pending ops to complete on error
I saw in a stack trace that the main thread was calling `exit()` even while
worker threads were alive and doing sha256/write/fsync etc. for objects.

The stack trace was a SEGV as the main thread was calling into library
`atexit()` handlers and we were a liblz4 destructor:

```
 #0  0x00007f2db790f8d4 _fini (liblz4.so.1)
 #1  0x00007f2dbbae1c68 __run_exit_handlers (libc.so.6)
```

(Why that library has a destructor I don't know offhand, can't find
 it in the source in a quick look)

Anyways, global library destructors and worker threads continuing simply don't
mix. Let's wait for our outstanding operations before we exit. This is also a
good idea for projects using libostree as a shared library, as we don't want
worker threads outliving operations.

Our existing pull corruption tests exercise coverage here.

I added a new `caught-error` status boolean to the progress API, and use it the
commandline to tell the user that we're waiting for outstanding ops.

Closes: #1185
Approved by: jlebon
2017-09-19 19:05:26 +00:00
..
boot boot: Add a tmpfiles.d snippet to clean up /var/tmp/ostree-ovl.XXX 2017-08-17 18:38:45 +00:00
libostree lib/pull: Wait for pending ops to complete on error 2017-09-19 19:05:26 +00:00
libotutil tree-wide: Some glnx_fstatat_allow_noent() porting 2017-09-19 15:03:05 +00:00
ostree bin/prune: Add --only-branch 2017-09-18 17:20:38 +00:00
rofiles-fuse rofiles-fuse: Fix lchown() and hardlink verification for symlinks 2017-09-08 20:38:39 +00:00
switchroot tree-wide: Add a few missing O_CLOEXEC 2017-05-16 17:34:46 +00:00