OpenBazaar / openbazaar-go

OpenBazaar 2.0 Server Daemon in Go
MIT License
993 stars 283 forks source link

Database used by after closing when shutting down #1372

Open tyler-smith opened 5 years ago

tyler-smith commented 5 years ago

This is happening consistently for me. DB is being used by recordAgingNotifier.

^C10:05:38.795 [NOTICE] [main/func1] Received interrupt
10:05:38.795 [INFO] [main/func1] OpenBazaar Server shutting down...
10:05:44.764 [INFO] [service/New] OpenBazaar service running at /openbazaar/app/testnet/1.0.0
10:05:44.765 [WARNING] [client/func2] websocket disconnected: tbch.blockbook.api.openbazaar.org
10:05:44.765 [ERROR] [service/Republish] sql: database is closed
10:05:44.765 [WARNING] [client/func2] websocket disconnected: tzec.blockbook.api.openbazaar.org
10:05:44.765 [ERROR] [cmd/func4] sql: database is closed
10:05:44.765 [WARNING] [client/func2] websocket disconnected: tltc.blockbook.api.openbazaar.org
10:05:44.766 [WARNING] [client/func2] websocket disconnected: tbtc.blockbook.api.openbazaar.org
10:05:44.765 [ERROR] [recordAgingNotifier/PerformTask] generateSellerDisputeNotifications failed: selecting sales: sql: database is closed
10:05:44.766 [ERROR] [recordAgingNotifier/PerformTask] generateBuyerDisputeTimeoutNotifications failed: selecting purchases: sql: database is closed
10:05:44.766 [ERROR] [recordAgingNotifier/PerformTask] generateBuyerDisputeExpiryNotifications failed: selecting purchases: sql: database is closed
10:05:44.766 [ERROR] [recordAgingNotifier/PerformTask] generateModeratorDisputeExpiryNotifications failed: selecting dispute case: sql: database is closed
10:05:44.766 [DEBUG] [recordAgingNotifier/PerformTask] notifications created/records updated: 
exit status 1
placer14 commented 5 years ago

Here's another case of this where the wallet attempted to use the datastore during a shutdown:

21:20:48.286 [INFO] [WalletService/processIncomingBlock] Received new Zcash block at height 481128: 00000000000f489742422bff055f752cde92a666aaed91db4738fc9eb4665ce8
21:20:48.287 [ERROR] [WalletService/processIncomingBlock] Error loading Zcash txs from db: sql: database is closed

21:21:26.425 [INFO] [WalletService/processIncomingBlock] Received new Bitcoin Cash block at height 569652: 0000000000000000018dd9fbfe005a4d7a17c93f521e981df51a47a2dcf56d8f
21:21:26.425 [ERROR] [WalletService/processIncomingBlock] Error loading Bitcoin Cash txs from db: sql: database is closed

21:26:06.274 [INFO] [WalletService/processIncomingBlock] Received new Zcash block at height 481129: 000000000162fa75f4673b17d51364a03be5d56c112597abdadd845a7eed8889
21:26:06.274 [ERROR] [WalletService/processIncomingBlock] Error loading Zcash txs from db: sql: database is closed

From the user:

I tried sending a bech32 payment from the BTC wallet and it just spun. After a long time I tried shutting down the app but it isn't closing. It's been at least half an hour now.