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

MBHD did not shut down cleanly #531

Closed
jim618 opened this issue Apr 20, 2015 · 2 comments
Closed

MBHD did not shut down cleanly #531

jim618 opened this issue Apr 20, 2015 · 2 comments
Assignees
Milestone

Comments

@jim618
Copy link
Contributor

jim618 commented Apr 20, 2015

Shut down MBHD - the GUI disappears but the process (and icon in Mac OS) did not disappear

Error in log:

[2015-04-20 12:58:56,165] DEBUG [safe-fixed-core-events-0] o.m.h.c.m.WalletManager - Saving wallet with id : 3a331738-d6f4a2ac-0ee81449-ba205c79-c1af7472, height : 352919 
[2015-04-20 12:58:56,464] DEBUG [Wallet autosave thread] o.m.h.c.m.WalletAutoSaveListener - Auto-saving wallet to tempFile:
'/Users/jim/Library/Application Support/MultiBitHD/mbhd-3a331738-d6f4a2ac-0ee81449-ba205c79-c1af7472/wallet5594042031802469823.tmp' 
[2015-04-20 12:58:56,504] DEBUG [Wallet autosave thread] o.m.h.c.m.WalletAutoSaveListener - Wallet auto-saved to newlySavedFile:
'/Users/jim/Library/Application Support/MultiBitHD/mbhd-3a331738-d6f4a2ac-0ee81449-ba205c79-c1af7472/mbhd.wallet' 
[2015-04-20 12:58:56,839] ERROR [safe-fixed-core-events-0] o.m.h.c.e.ExceptionHandler - Cannot make encrypted copy for file '/Users/jim/Library/Application Support/MultiBitHD/mbhd-3a331738-d6f4a2ac-0ee81449-ba205c79-c1af7472/mbhd.wallet' ! org.multibit.hd.core.exceptions.EncryptedFileReaderWriterException: Cannot make encrypted copy for file '/Users/jim/Library/Application Support/MultiBitHD/mbhd-3a331738-d6f4a2ac-0ee81449-ba205c79-c1af7472/mbhd.wallet'
! at org.multibit.hd.core.crypto.EncryptedFileReaderWriter.encryptAndDeleteOriginal(EncryptedFileReaderWriter.java:296) ~[multibit-hd.jar:na]
! at org.multibit.hd.core.crypto.EncryptedFileReaderWriter.makeAESEncryptedCopyAndDeleteOriginal(EncryptedFileReaderWriter.java:157) ~[multibit-hd.jar:na]
! at org.multibit.hd.core.crypto.EncryptedFileReaderWriter.makeAESEncryptedCopyAndDeleteOriginal(EncryptedFileReaderWriter.java:138) ~[multibit-hd.jar:na]
! at org.multibit.hd.core.managers.WalletManager.saveWallet(WalletManager.java:1821) ~[multibit-hd.jar:na]
SNIP
! at org.multibit.hd.core.services.CoreServices.shutdownNow(CoreServices.java:205) ~[multibit-hd.jar:na]
! at org.multibit.hd.ui.controllers.MainController.shutdownCurrentWallet(MainController.java:640) ~[multibit-hd.jar:na]
! at org.multibit.hd.ui.controllers.MainController.onShutdownEvent(MainController.java:168) ~[multibit-hd.jar:na]
SNIP
Caused by: ! java.io.FileNotFoundException: /Users/jim/Library/Application Support/MultiBitHD/mbhd-3a331738-d6f4a2ac-0ee81449-ba205c79-c1af7472/mbhd.wallet (No such file or directory)
SNIP
org.multibit.hd.core.crypto.EncryptedFileReaderWriter.encryptAndDeleteOriginal(EncryptedFileReaderWriter.java:277) ~[multibit-hd.jar:na]

Had to force quit

@jim618 jim618 added this to the Release 0.1 milestone Apr 20, 2015
@jim618 jim618 self-assigned this Apr 20, 2015
jim618 added a commit that referenced this issue Apr 23, 2015
@jim618
Copy link
Contributor Author

jim618 commented Apr 23, 2015

I think this was caused by the shutdown code invoking saveWallet whilst the WalletAutoSaveListener was also doing the same.
I have improved EncryptedFileReaderWriter#encryptAndDeleteOriginal so that:

  • it is synchronized
  • it checks the wallet file actually exists before attempting to read/encrypt/delete

It's not easily reproducible this bug so we'll just have to watch the CrashReporter for any similar reports.

Awaiting code review and closing.

@gary-rowe
Copy link
Contributor

Code review LGTM.

Closing.

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

2 participants