@Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        URL url = invoker.getUrl();
        String methodName = RpcUtils.getMethodName(invocation);
        int max = url.getMethodParameter(methodName, EXECUTES_KEY, 0);
        if (!RpcStatus.beginCount(url, methodName, max)) {
            throw new RpcException(
                    RpcException.LIMIT_EXCEEDED_EXCEPTION,
                    "Failed to invoke method " + RpcUtils.getMethodName(invocation) + " in provider " + url
                            + ", cause: The service using threads greater than <dubbo:service executes=\"" + max
                            + "\" /> limited.");
        }

        invocation.put(EXECUTE_LIMIT_FILTER_START_TIME, System.currentTimeMillis());
        try {
            return invoker.invoke(invocation);
        } catch (Throwable t) {
            if (t instanceof RuntimeException) {
                throw (RuntimeException) t;
            } else {
                throw new RpcException("unexpected exception when ExecuteLimitFilter", t);
            }
        }
    }
@Test
    void testMoreThanExecuteLimitInvoke() {
        int maxExecute = 10;
        int totalExecute = 20;
        final AtomicInteger failed = new AtomicInteger(0);

        final Invocation invocation = Mockito.mock(RpcInvocation.class);
        when(invocation.getMethodName()).thenReturn("testMoreThanExecuteLimitInvoke");

        URL url = URL.valueOf("test://test:11/test?accesslog=true&group=dubbo&version=1.1&executes=" + maxExecute);
        final Invoker<ExecuteLimitFilter> invoker = new BlockMyInvoker<>(url, 1000);

        final CountDownLatch latchThatWaitsAllThreadStarted = new CountDownLatch(1);
        final CountDownLatch latchThatWaitsAllThreadFinished = new CountDownLatch(totalExecute);

        for (int i = 0; i < totalExecute; i++) {

            Thread thread = new Thread(() -> {
                try {
                    latchThatWaitsAllThreadStarted.await();
                    executeLimitFilter.invoke(invoker, invocation);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                } catch (RpcException expected) {
                    failed.incrementAndGet();
                } finally {
                    latchThatWaitsAllThreadFinished.countDown();
                }
            });

            thread.start();
        }

        latchThatWaitsAllThreadStarted.countDown();

        try {
            latchThatWaitsAllThreadFinished.await();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        Assertions.assertEquals(totalExecute - maxExecute, failed.get());
    }