(Client client, Object error)
| 1775 | } |
| 1776 | |
| 1777 | @SuppressWarnings("unchecked") |
| 1778 | private void cleanupWsClient(Client client, Object error) { |
| 1779 | var clientsMap = (java.util.concurrent.ConcurrentHashMap<String, Client>) this.clients; |
| 1780 | var urlClient = clientsMap.get(client.url); |
| 1781 | if (urlClient != null) { |
| 1782 | urlClient.subscriptionsMap().clear(); |
| 1783 | urlClient.reject(wrapAsNetworkError(error)); |
| 1784 | clientsMap.remove(client.url); |
| 1785 | // NOTE: do NOT call urlClient.close() here. Empirical test (full |
| 1786 | // Java WS sweep) showed close()'s messageExecutor.shutdown() races |
| 1787 | // with in-flight handleMessage tasks the per-exchange tests still |
| 1788 | // need, causing 15 new exchanges to time out vs the baseline. |
| 1789 | // The leak the close() was meant to fix is slow-drip (virtual |
| 1790 | // threads ~1KB each); we'll address it via a different mechanism |
| 1791 | // (e.g. shutdown-on-Exchange.close() only, or a delayed shutdown). |
| 1792 | } |
| 1793 | } |
| 1794 | |
| 1795 | /** |
| 1796 | * Wrap raw Netty / I/O exceptions in a CCXT NetworkError so the test harness's |
no test coverage detected