decred / dcrdex

The Decred Decentralized Exchange (DEX), powered by atomic-swaps.
Other
184 stars 91 forks source link

Errors unsubscribing from orderbooks after already disconnecting from the server. #2883

Open matthawkins90 opened 1 month ago

matthawkins90 commented 1 month ago

Weird bug when I tried to ^C the dex. BTC wallet was still syncing, but everything else was fully synced:

^C
2024-07-25 05:07:13.410 [INF] BW: Attempting to logout...
2024-07-25 05:07:13.410 [INF] CORE: Locking DCR wallet
2024-07-25 05:07:13.410 [INF] CORE: Locking LTC wallet
2024-07-25 05:07:13.410 [INF] CORE: Locking POLYGON wallet
2024-07-25 05:07:13.410 [INF] BW: Shutting down...
2024-07-25 05:07:13.410 [DBG] CORE: notify: |POKE| (conn) Server disconnect - dex.decred.org:7232 is disconnected
2024-07-25 05:07:13.410 [DBG] CORE[wss://dex.decred.org:7232/ws]: Sending close 1000 (normal) message.
2024-07-25 05:07:13.410 [DBG] CORE: notify: |POKE| (conn) Server disconnect - bison.exchange:7232 is disconnected
2024-07-25 05:07:13.410 [DBG] CORE[wss://bison.exchange:7232/ws]: Sending close 1000 (normal) message.
2024-07-25 05:07:13.410 [ERR] WEB[WS][127.0.0.1:35188]: Websocket receive error from peer 127.0.0.1:35188: read tcp 127.0.0.1:5758->127.0.0.1:35188: use of closed network connection (*websocket.netError)
2024-07-25 05:07:13.410 [INF] WEB: Web server off
2024-07-25 05:07:13.510 [INF] CORE[DB]: Backing up database...
2024-07-25 05:07:13.568 [DBG] CORE[DB]: Total DB size 471040 bytes, 12328 bytes unused (2.62%)
2024-07-25 05:07:13.568 [INF] CORE[btc][SPV]: Unloading wallet
2024-07-25 05:07:28.310 [DBG] CORE: Unsubscribing from the ltc_usdt.polygon order book for bison.exchange:7232
2024-07-25 05:07:28.310 [ERR] CORE[wss://bison.exchange:7232/ws]: (*wsConn).Request(route 'unsub_orderbook') Send error (cannot send on a broken connection), unregistering msg ID 17 handler
2024-07-25 05:07:28.310 [ERR] CORE: request error unsubscribing from ltc_usdt.polygon orderbook: cannot send on a broken connection
2024-07-25 05:07:42.887 [DBG] CORE: Unsubscribing from the dcr_ltc order book for bison.exchange:7232
2024-07-25 05:07:42.887 [ERR] CORE[wss://bison.exchange:7232/ws]: (*wsConn).Request(route 'unsub_orderbook') Send error (cannot send on a broken connection), unregistering msg ID 18 handler
2024-07-25 05:07:42.887 [ERR] CORE: request error unsubscribing from dcr_ltc orderbook: cannot send on a broken connection

Looks like unsubscribing from the order books is happening after I've already disconnected. It caused a hang and isn't fully shutting down now.

buck54321 commented 1 month ago

Pretty sure this from a different bug described in #2899.