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

Fix inverted condition for fsync warning #231

Merged
merged 3 commits into from May 18, 2023

Conversation

MichaelEischer
Copy link
Member

@MichaelEischer MichaelEischer commented May 8, 2023

What is the purpose of this change? What does it change?

The warning should only be printed if fsync is not supported and not the other way around.

TODO:

  • Investigate why the warning was printed multiple times.

Was the change discussed in an issue or in the forum before?

Fixes #230
Regressed in #199

Checklist

  • I have enabled maintainer edits for this PR
  • I have added tests for all changes in this PR
  • [ ] I have added documentation for the changes (in the manual)
  • There's a new file in changelog/unreleased/ that describes the changes for our users (template here)
  • I have run gofmt on the code in all commits
  • All commit messages are formatted in the same style as the other commits in the repo
  • I'm done, this Pull Request is ready for review

The warning should only be printed if fsync is _not_ supported and not
the other way around.
The repo.Handler is freshly instantiated for every request such that it
forget that the fsync warning was already printed. Use a single instance
in the Server instead.
@MichaelEischer MichaelEischer merged commit 0cd077f into restic:master May 18, 2023
5 checks passed
@MichaelEischer MichaelEischer deleted the fix-fsync-warning branch May 18, 2023 14:36
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Oct 19, 2023
Fix PKGNAME while here.

Changelog for rest-server 0.12.1 (2023-07-09)
============================================

The following sections list the changes in rest-server 0.12.1 relevant
to users. The changes are ordered by importance.

Summary
-------

 * Fix #230: Fix erroneous warnings about unsupported fsync
 * Fix #238: API: Return empty array when listing empty folders
 * Enh #217: Log to stdout using the `--log -` option

Details
-------

 * Bugfix #230: Fix erroneous warnings about unsupported fsync

   Due to a regression in rest-server 0.12.0, it continuously printed `WARNING: fsync is not
   supported by the data storage. This can lead to data loss, if the system crashes or the storage is
   unexpectedly disconnected.` for systems that support fsync. We have fixed the warning.

   restic/rest-server#230
   restic/rest-server#231

 * Bugfix #238: API: Return empty array when listing empty folders

   Rest-server returned `null` when listing an empty folder. This has been changed to returning
   an empty array in accordance with the REST protocol specification. This change has no impact on
   restic users.

   restic/rest-server#238
   restic/rest-server#239

 * Enhancement #217: Log to stdout using the `--log -` option

   Logging to stdout was possible using `--log /dev/stdout`. However, when the rest server is run
   as a different user, for example, using

   `sudo -u restic rest-server [...] --log /dev/stdout`

   This did not work due to permission issues.

   For logging to stdout, the `--log` option now supports the special filename `-` which also
   works in these cases.

   restic/rest-server#217
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.

WARNING: fsync is not supported by the data storage
1 participant