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

Bug fix save&restore logging #2356

Merged
merged 3 commits into from
Aug 19, 2022
Merged

Bug fix save&restore logging #2356

merged 3 commits into from
Aug 19, 2022

Conversation

georgweiss
Copy link
Collaborator

I have also removed the dialog showing list of PVs that were not written during restore. Main reason is that it interferes with the log entry editor launched. But failures should be communicated differently, e.g. a separate column in the table view indicating row by row about write result. This I will add next.

@georgweiss georgweiss requested a review from shroffk August 16, 2022 08:12
@kasemir
Copy link
Collaborator

kasemir commented Aug 16, 2022

When some PVs can be written, others not, it's a good question what one should to vs. what's practically possible.

Will the log entry dialog be pre-configured with text that shows what values were written and which PVs failed to be written, so whatever happened is logged?

Or will there be two dialogs opening up, one for the log entry and one for the write error?

Is the restoral somehow treated as a transaction? In 'PACE', if any of the writes fail, we'll try to restore the previous values for everything,

final String user = logEntryModel.getUsername();
try
{ // Change PVs
model.saveUserValues(user);
// On success, clear user values
model.clearUserValues();
}
catch (Exception ex)
{
logger.log(Level.WARNING, "Save failed", ex);
// At least some saves failed, to revert
try
{
model.revertOriginalValues();
}
catch (Exception ex2)
{
// Since saving didn't work, restoral will also fail.
// Hopefully those initial PVs that did get updated will
// also be restored...
logger.log(Level.WARNING, "Restore failed", ex2);
}
ExceptionDetailsErrorDialog.openError(gui, Messages.SaveError, Messages.PVWriteError, ex);
because the idea for the tool. Of course there are no real transactions with Channel Access or PV Access, we simply hope that those PVs we could write can be written once more with the previous value to get a "rollback".

@georgweiss
Copy link
Collaborator Author

The log entry is "pre configured" to list PVs that failed to write. Plus there will be a link to the snapshot so user can open it from the log entry viewer.

Rollback has never been in scope for save&restore. But I do not mind adding such a feature.

@georgweiss
Copy link
Collaborator Author

I removed the error dialog as in some cases the log entry editor dialog went hiding behind the main window.

@shroffk shroffk merged commit 2e5ba3e into master Aug 19, 2022
@georgweiss georgweiss deleted the SaveRestoreLogFix branch May 31, 2023 05:41
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.

3 participants