SaveState() result in suspending of plugin

Posted by Vbeau on Tue 18 Sep 2018 05:57 AM — 9 posts, 27,940 views.

#0
A model dialog appeared to point out "Unable to create the plugin save state file" when executing SaveState() in my plugin scripts.
The probability was 1%, but the problem is that the dialog caused suspending of the plugin until I closed the dialog. This is disconcerting when going on an unattended operation for a long time.
USA Global Moderator #1
I think you should be focusing on what caused MUSHclient to be locked out of saving the state file. Perhaps you have it stored in a location that it isn't able to write to?

Quote:
but the problem is that the dialog caused suspending of the plugin until I closed the dialog

I don't see this as a problem. Continuing operation while ignoring serious errors doesn't seem like a reasonable approach to me.
Amended on Tue 18 Sep 2018 06:09 PM by Fiendish
#2
First of all, thanks for your reply. Then it needs to be emphasized that the probability of the failed appearance is 1% and SaveState() is called at set intervals. Last but not least, my question is that the rare failure of SaveState() shoud result in MUSHclient to be locked? Would it be better that the next step
is processed by users according to the return value after failure of saving the state file?
USA Global Moderator #3
What do you mean that the probability is 1%? Saving the file should _never_ fail. If it fails even once then there is a serious system problem.
Amended on Wed 19 Sep 2018 02:37 AM by Fiendish
Australia Forum Administrator #4
In most programs, the inability to save a file results in a dialogue box requiring you to fix it before you proceed.

In the case of saving the state file, if you can do it one time you should be able to do it a thousand times.
#5
I mean that the probability is 1% indeed.
Australia Forum Administrator #6

Yes, why is it 1%? Is there any reason why saving to disk fails one time out of a hundred?

#7
I did a test for SaveState() and there was one time of failure in 100 times. So I think probability is 1%. Perhaps the numerical value isn't accurate, however my purpose is to illustrate that the low probability risk for saving to disk exists indeed.
Australia Forum Administrator #8
This isn’t really a bug IMHO, because you may as well complain that Microsoft Word opens a dialogue box when it is unable to save the document. Surely you want to be notified, rather than just have the program proceed as if nothing happened?

The core issue is, why are 1% of the saves failing? No one else has ever complained about this.