dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beiwei30 (GitHub) <git...@apache.org>
Subject [GitHub] [incubator-dubbo] beiwei30 commented on pull request #3035: [DUBBO-3023]: problem in ActiveLimitFilter
Date Fri, 21 Dec 2018 05:41:45 GMT
first of all, `endCount` does more than limiting the traffic only, it is also responsible for
running statistics, see below:

```java
    private static void endCount(RpcStatus status, long elapsed, boolean succeeded) {
        status.active.decrementAndGet();
        status.total.incrementAndGet();
        status.totalElapsed.addAndGet(elapsed);
        if (status.maxElapsed.get() < elapsed) {
            status.maxElapsed.set(elapsed);
        }
        if (succeeded) {
            if (status.succeededMaxElapsed.get() < elapsed) {
                status.succeededMaxElapsed.set(elapsed);
            }
        } else {
            status.failed.incrementAndGet();
            status.failedElapsed.addAndGet(elapsed);
            if (status.failedMaxElapsed.get() < elapsed) {
                status.failedMaxElapsed.set(elapsed);
            }
        }
    }
```

That's the reason we need to make sure `startCount` and `endCount` execute no matter `max`
limit is set or not, but at the same time, we also need to make sure the filter will block
incoming request if `max` limit exceeds.

[ Full content available at: https://github.com/apache/incubator-dubbo/pull/3035 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


Mime
View raw message