Shut down Win without exiting Everything?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
Biff
Posts: 1158
Joined: Mon May 25, 2015 7:09 am

Shut down Win without exiting Everything?

Post by Biff »

When the database is saved (here automatically each three hours) and the settings are saved / not changed can I then just shut down Windows (or kill the Everything process in the Task Manager) without exiting Everything before without causing problems?
Thy Grand Voidinesss
Posts: 691
Joined: Wed Jun 01, 2022 5:01 pm

Re: Shut down Win without exiting Everything?

Post by Thy Grand Voidinesss »

I have been using version 1.5 for a year now and as always executing forced shutdowns and resets of my Windows 10 Enterprise 20H2 x64 and have not experience glitches [unlike in some other popular programs, especially if system has crashed one way or another or did not wake up properly]. And when I change my settings in Everything I always kill its process before making new copy, just to be on the safe side of backing up all of them in a ready-to-use state

The only thing that has happened maybe due to forced shutdowns was this viewtopic.php?p=56223#p56223, but its cause remains unknown to me and so far has not come back
void
Developer
Posts: 16775
Joined: Fri Oct 16, 2009 11:31 pm

Re: Shut down Win without exiting Everything?

Post by void »

can I then just shut down Windows (or kill the Everything process in the Task Manager) without exiting Everything before without causing problems?
Yes, you can kill Everything.
Any changes to your database or settings since the last scheduled save will be lost.

Consider disabling db_save_on_exit to prevent Everything saving settings and data to disk when exiting Everything or shutting down Windows:
  • In Everything 1.5, from the Tools menu, click Options.
  • Click the Advanced tab on the left.
  • To the right of Show settings containing, search for:
    save
  • Select db_save_on_exit.
  • Set the value to: false
  • Click OK.
Biff
Posts: 1158
Joined: Mon May 25, 2015 7:09 am

Re: Shut down Win without exiting Everything?

Post by Biff »

Okey, thank you very much!
Consider disabling db_save_on_exit to prevent Everything saving settings and data to disk when exiting Everything or shutting down Windows:
Because in this state (shutting down while saving) the database might or will get corrupted?
void
Developer
Posts: 16775
Joined: Fri Oct 16, 2009 11:31 pm

Re: Shut down Win without exiting Everything?

Post by void »

Because in this state (shutting down while saving) the database might or will get corrupted?
Generally, terminating Everything shouldn't cause any corruption.
Corruption can occur if Windows doesn't shutdown gracefully. (buffers not flushed to disk)

When Everything saves your database to disk:
Everything writes the database to Everything.db.tmp
Once written, Everything.db.tmp is renamed to Everything.db
This rename is consider atomic.
However, it is possible for the rename to be flushed to disk before the actual database data is flushed to disk.

Everything will keep a backup of your database in case it becomes corrupted.
Biff
Posts: 1158
Joined: Mon May 25, 2015 7:09 am

Re: Shut down Win without exiting Everything?

Post by Biff »

This rename is consider atomic.
Sorry, what does that mean?
However, it is possible for the rename to be flushed to disk before the actual database data is flushed to disk.
And that would not cause any damage to the file but one had to rename it if need be.
Everything will keep a backup of your database in case it becomes corrupted.
So then one simply manually would have to rename the backed up database to the database name.
void
Developer
Posts: 16775
Joined: Fri Oct 16, 2009 11:31 pm

Re: Shut down Win without exiting Everything?

Post by void »

The rename cannot be in partial or incomplete state.

Either the file renamed, or it didn't.

It basically means Everything cannot be in a corrupted or unknown state, provided Windows flushes caches to disk.
Biff
Posts: 1158
Joined: Mon May 25, 2015 7:09 am

Re: Shut down Win without exiting Everything?

Post by Biff »

OK, many thanks!
therube
Posts: 4985
Joined: Thu Sep 03, 2009 6:48 pm

Re: Shut down Win without exiting Everything?

Post by therube »

(Regardless of how robust a particular application [or Everything] may be, IMO, you close your programs before shutting down a computer. Simple :-). [As far as hard killing something...])

provided Windows flushes caches to disk
And a kill -9 (or power outage) would (still) flush the cache?

KILL (9) − This signal is used to immediately terminate a process, without allowing it to clean up or save any data. This signal cannot be ignored by the process.
void
Developer
Posts: 16775
Joined: Fri Oct 16, 2009 11:31 pm

Re: Shut down Win without exiting Everything?

Post by void »

And a kill -9 (or power outage) would (still) flush the cache?
Yes, the database will be on disk or in the OS cache if the Everything.db.tmp was successfully renamed to Everything.db.

If you terminate Everything before the rename: New changes to the database will be lost. Old database remains unchanged.
If you terminate Everything after the rename: Complete up-to-date database will be written to disk or in OS cache.

There's no in-between state.
Either the rename occurs or fails.
Post Reply