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

Usability and Mac improvements #14

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

RJVB
Copy link

@RJVB RJVB commented Jan 9, 2019

This is the PR announced in issue #13 . It's become a bit of a catch-all for a number of more or less (un)related changes:

  • add support for an optional sync-on-exit (end sync). Set EATMYDATA_END_SYNC=1 to do this only in the application launched by the user, set it EATMYDATA_END_SYNC=2 to do it in every child process too (that does slow things down if the child processes each do only tiny bits of work).
  • verbose mode: Set EATMYDATA_VERBOSE to print out the number of syncs and sync modes that were swallowed. Uses a simple counter without any thread-safeties because there's nothing crucial to the feature and I don't want to introduce locks in overloads of functions that have to remain signal-safe.
  • Mac-related fixes, making the code build and the scripts run on 10.9 (and up, presumably).

And, a bit stupidly: a source code reformat.

Adds an exit() overload and a library destructor routine
that call libc_sync() when syncs have been eaten and the
EATMYDATA_END_SYNC env. var is set. They also print how
many syncs were swallowed, if EATMYDATA_VERBOSE is set.

Committed from host : Portia.local
Committed from host : Portia.local
let the OS deallocate progName and cache nosyncs before printing,
all to prevent race conditions and print something that's less
likely to be wrong.

Committed from host : Bola
Set EATMYDATA_END_SYNC=1 to sync only when the 1st eatmydata instance
exits (libeatmydata reads and unsets the variable internally). Use
EATMYDATA_END_SYNC=2 to present the variable and cause an end-sync in
each child process.

Also, reformat the source.

Committed from host : Portia.local
EATMYDATA_END_SYNC=-1 will disable eating syncs after exit() or _exit()
have been called, allowing the libc runtime to do any of the explicit
syncs it wants to do. A new close() overload also starts doing explicit
fsync's on the descriptors it has to close.

Potential because I haven't yet seen it do any syncs or NOT eat any.

Committed from host : Bola
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 this pull request may close these issues.

1 participant