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

Program crashes after computer wakes up from sleeping #2120

Open
damichab opened this issue Sep 17, 2022 · 15 comments
Open

Program crashes after computer wakes up from sleeping #2120

damichab opened this issue Sep 17, 2022 · 15 comments

Comments

@damichab
Copy link

Cherrytree is prone to crashing after it loses access to an open file.

To recreate problem...

  1. Create a network share on ANOTHER computer.
  2. Map a drive to the network share.
  3. Open two large Cherrytree documents through the network share.
  4. Do lots of important work and forget to save (this step is optional).
  5. Let computer go to sleep (get called away by the wife etc.) and then wake it up again. (Rebooting the router is good too.)
  6. Within Cherrytree, move a node (the instant option).
    Continuing to work will also do it, but at a random time.
    Moving a number of nodes in quick succession is not a good practice either.
    Working on the one document for several hours and then trying to click on another node and clicking back also not good.
  7. All open Cherrytree documents close without warning and without saving.

This is an old problem (5 years I am guessing) that I have emailed about before. Currently on latest version of Windows 10 and latest update of Cherrytree with files stored on a Windows 2016 home file server. Still, as frustrating as this problem is, I still consider this the best program for what I need!

Cheers,
David.

@giuspen
Copy link
Owner

giuspen commented Sep 19, 2022

@damichab can you confirm that this issue happens only with the sqlite database (ctb) and not with the xml (ctd)?

@damichab
Copy link
Author

@damichab can you confirm that this issue happens only with the sqlite database (ctb) and not with the xml (ctd)?

It happens with the sqlite files. Whether or not it only happens with sqlite files I do not know. I will test this out next week sometime. While I am at it, I will also test if file size is a factor or not as well.

@bitboy85
Copy link

bitboy85 commented Nov 1, 2023

Confirm this one. Even just clicking another node within an opened document will close cherrytree.
I'm using an sqlite db too.

@giuspen
Copy link
Owner

giuspen commented Nov 5, 2023

Sorry it took so long, I can see how it crashes wonderfully when it loses access to an open file. I'll try to make it more robust.

@damichab
Copy link
Author

damichab commented Nov 5, 2023 via email

@damichab
Copy link
Author

damichab commented Dec 30, 2023 via email

@damichab
Copy link
Author

Untitled

@giuspen
Copy link
Owner

giuspen commented Dec 30, 2023

Hi David,
Do you have a custom backup folder defined or is it the default so in the same folder of your Adelaide.ctb file?
So you are saying that you hit Ctrl+S and you leave your computer, you came back and you find this error? (You don't have auto save on)
After the error the Adelaide.ctb has the latest changes saved correctly. You haven't investigated if the backup file is indeed corrupted (could you try and open it to see if it is good?)

@damichab
Copy link
Author

damichab commented Jan 2, 2024

Hi Giuseppe,

I have had a bit more of a play with saving. I have a (Windows 2016) server which has upon it a personal directory which I map to my computer as 'H' drive.

H:\Vinitage Photos\

is the directory I keep several CherryTree files, one of which is Adelaide.ctb.

I configured settings to send CherryTree backups to...

H:\CherryTree Backups\

CherryTree makes its own subdirectories for each file within the backup directory. The files in this directory once the tilde(s) removed, open just fine. From my notebook, I managed (accidently) to recreate the error and I think I now know more about what is going on. I opened Adelaide.ctb, worked on the file for a while, manually saved the file and closed the screen. A hour or two later, I opened the screen and saw the error. I click on and the program just hangs. In the past with this error, waiting did not do anything. I can only close the Cherry tree file by the Winodws Error Message "The program is not responging", and clicking .

The file that I am working on is saved properly. I think that the problem is just that I closed the computer down before the intermediate backup file (with the numbers at the end of it) was moved to the backup directory. This intermediate backup file also opens just fine and only goes away when I manually delete it.

You might want to check for intermediate backup files upon opening a file and move it to the backup folder perhaps.

Anyway, hope this rundown helps.

I have another suggestion about saving too... Because my file is so large, it takes time to save, to the order of several minutes. Consequently I have the auto save set to 2 hours. Every so often I save manually, but then a short while later (less then 2 hours) the auto save kicks in and resaves the file. How about resetting the time of auto save from the time of the last manual save. The auto save is important for those times you get carried away and forget to save for a while, but it does not need to kick in less then the allocated time after a manual save.

-- David.

@giuspen
Copy link
Owner

giuspen commented Jan 3, 2024

Hi David, thanks for your description, I will review the saving with backup in case of a very large SQLite file.

I think it makes definitely sense to reset the autosave timeout when you manually save, I shall have a look.

I'm surprised though that it takes so long to save your SQLite file, I wonder if it would make sense for you to try and save your data using the recent new type called "Multiple Files in Hierarchical Folder Structure" - that would probably be much faster for you as that is backing up (and rotating) only the data that is updated while with SQLite I have no other option than backing up (and rotating) the whole db all the times.

@damichab
Copy link
Author

damichab commented Jan 4, 2024 via email

@giuspen
Copy link
Owner

giuspen commented Jan 4, 2024

In the last two hours your pc was running or suspended?

@damichab
Copy link
Author

damichab commented Jan 4, 2024 via email

giuspen added a commit that referenced this issue Jan 6, 2024
@giuspen
Copy link
Owner

giuspen commented Jan 6, 2024

Ok I added the reset of the autosave timeout when you save manually and also ensured that the suspended time doesn't add up in the autosave timeout

@damichab
Copy link
Author

damichab commented Jan 7, 2024 via email

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

No branches or pull requests

3 participants