@Override
    public Response request(Request request, long timeoutMills) throws NacosException {
        DefaultRequestFuture pushFuture = sendRequestInner(request, null);
        try {
            return pushFuture.get(timeoutMills);
        } catch (Exception e) {
            throw new NacosException(NacosException.SERVER_ERROR, e);
        } finally {
            RpcAckCallbackSynchronizer.clearFuture(getMetaInfo().getConnectionId(), pushFuture.getRequestId());
        }
    }
@Test
    void testIllegalStateException() {
        Mockito.doReturn(new DefaultEventLoop()).when(channel).eventLoop();
        Mockito.doThrow(new IllegalStateException()).when(streamObserver).onNext(Mockito.any());
        Mockito.doReturn(true).when(streamObserver).isReady();
        
        try {
            connection.request(new NotifySubscriberRequest(), 1000L);
            assertTrue(false);
        } catch (Exception e) {
            assertTrue(e instanceof ConnectionAlreadyClosedException);
            assertTrue(e.getCause() instanceof IllegalStateException);
        }
    }