[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-26 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16629607#comment-16629607
 ] 

ASF GitHub Bot commented on SCB-932:


liubao68 closed pull request #922: [SCB-932]Time jump cause the new request 
injected
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/922
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
 
b/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
index 8bc147b8c..88c80749e 100644
--- 
a/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
+++ 
b/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
@@ -24,13 +24,13 @@
 
   private Integer qpsLimit;
 
-  // 本周期的开始时间
+  // Interval begin time
   private volatile long msCycleBegin;
 
-  // 到目前为止的请求数
+  // Request count between Interval begin and now in one interval
   private AtomicLong requestCount = new AtomicLong();
 
-  // 本周期之前的请求数
+  // request count  before an interval
   private volatile long lastRequestCount = 1;
 
   private static final int CYCLE_LENGTH = 1000;
@@ -53,20 +53,21 @@ public void setQpsLimit(Integer qpsLimit) {
 this.qpsLimit = qpsLimit;
   }
 
-  // 返回true,表示需要被控制
+  // return true means new request need to be rejected
   public boolean isLimitNewRequest() {
 long newCount = requestCount.incrementAndGet();
 long msNow = System.currentTimeMillis();
-if (msNow - msCycleBegin > CYCLE_LENGTH) {
-  // 新周期
-  // 会有多线程竞争,互相覆盖的问题,不过无所谓,不会有什么后果
+//Time jump cause the new request injected
+if (msNow - msCycleBegin > CYCLE_LENGTH || msNow < msCycleBegin) {
+ 
+  //no need worry about concurrency porbleam  
   lastRequestCount = newCount;
   msCycleBegin = msNow;
 }
 
-// 配置更新与配置使用是多线程并发的
-// 所以可能operation级别刚刚更新为null
-// 还没来得及修改为引用schema级别或是microservice级别,其他线程还在使用,所以需要规避
+// Configuration update and use is at the situation of multi-threaded 
concurrency
+// It is possible that operation level updated to null,but schema level or 
microservice level does not updated
+
 int limitValue = (qpsLimit == null) ? Integer.MAX_VALUE : qpsLimit;
 return newCount - lastRequestCount >= limitValue;
   }


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16623197#comment-16623197
 ] 

ASF GitHub Bot commented on SCB-932:


coveralls commented on issue #922: [SCB-932]Time jump cause the new request 
injected
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/922#issuecomment-423441736
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/19118649/badge)](https://coveralls.io/builds/19118649)
   
   Coverage remained the same at 86.207% when pulling 
**b90ee1038431bcf46d7be1a40398a49d3d735d7b on laijianbin:patch-8** into 
**20627dd0af924dcdf51fe529afe49e51864dc18c on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16623187#comment-16623187
 ] 

ASF GitHub Bot commented on SCB-932:


coveralls edited a comment on issue #921: [SCB-932]Time jump cause the new 
request injected
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/921#issuecomment-423432716
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/19118565/badge)](https://coveralls.io/builds/19118565)
   
   Coverage decreased (-0.004%) to 86.203% when pulling 
**cb629df819e4ccceea0df6599c310cb89b98e23f on laijianbin:patch-7** into 
**20627dd0af924dcdf51fe529afe49e51864dc18c on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16623169#comment-16623169
 ] 

ASF GitHub Bot commented on SCB-932:


laijianbin commented on issue #921: [SCB-932]Time jump cause the new request 
injected
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/921#issuecomment-423436074
 
 
   submit another PR


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16623170#comment-16623170
 ] 

ASF GitHub Bot commented on SCB-932:


laijianbin closed pull request #921: [SCB-932]Time jump cause the new request 
injected
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/921
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
 
b/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
index 8bc147b8c..88c80749e 100644
--- 
a/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
+++ 
b/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
@@ -24,13 +24,13 @@
 
   private Integer qpsLimit;
 
-  // 本周期的开始时间
+  // Interval begin time
   private volatile long msCycleBegin;
 
-  // 到目前为止的请求数
+  // Request count between Interval begin and now in one interval
   private AtomicLong requestCount = new AtomicLong();
 
-  // 本周期之前的请求数
+  // request count  before an interval
   private volatile long lastRequestCount = 1;
 
   private static final int CYCLE_LENGTH = 1000;
@@ -53,20 +53,21 @@ public void setQpsLimit(Integer qpsLimit) {
 this.qpsLimit = qpsLimit;
   }
 
-  // 返回true,表示需要被控制
+  // return true means new request need to be rejected
   public boolean isLimitNewRequest() {
 long newCount = requestCount.incrementAndGet();
 long msNow = System.currentTimeMillis();
-if (msNow - msCycleBegin > CYCLE_LENGTH) {
-  // 新周期
-  // 会有多线程竞争,互相覆盖的问题,不过无所谓,不会有什么后果
+//Time jump cause the new request injected
+if (msNow - msCycleBegin > CYCLE_LENGTH || msNow < msCycleBegin) {
+ 
+  //no need worry about concurrency porbleam  
   lastRequestCount = newCount;
   msCycleBegin = msNow;
 }
 
-// 配置更新与配置使用是多线程并发的
-// 所以可能operation级别刚刚更新为null
-// 还没来得及修改为引用schema级别或是microservice级别,其他线程还在使用,所以需要规避
+// Configuration update and use is at the situation of multi-threaded 
concurrency
+// It is possible that operation level updated to null,but schema level or 
microservice level does not updated
+
 int limitValue = (qpsLimit == null) ? Integer.MAX_VALUE : qpsLimit;
 return newCount - lastRequestCount >= limitValue;
   }


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16623168#comment-16623168
 ] 

ASF GitHub Bot commented on SCB-932:


laijianbin opened a new pull request #922: [SCB-932]Time jump cause the new 
request injected
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/922
 
 
   [SCB-932]Time jump cause the new request injected
   
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16623157#comment-16623157
 ] 

ASF GitHub Bot commented on SCB-932:


coveralls commented on issue #921: [SCB-932]Time jump cause the new request 
injected
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/921#issuecomment-423432716
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/19118279/badge)](https://coveralls.io/builds/19118279)
   
   Coverage remained the same at 86.207% when pulling 
**7ac45bc5b70fa125bd607b22a51c6c9160e5eff9 on laijianbin:patch-7** into 
**20627dd0af924dcdf51fe529afe49e51864dc18c on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16623137#comment-16623137
 ] 

ASF GitHub Bot commented on SCB-932:


laijianbin commented on issue #919: [SCB-932]Time jump cause the new request 
injected
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/919#issuecomment-423428181
 
 
   submit another PR


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16623138#comment-16623138
 ] 

ASF GitHub Bot commented on SCB-932:


laijianbin closed pull request #919: [SCB-932]Time jump cause the new request 
injected
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/919
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
 
b/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
index 8bc147b8c..3cac48bbd 100644
--- 
a/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
+++ 
b/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
@@ -57,7 +57,8 @@ public void setQpsLimit(Integer qpsLimit) {
   public boolean isLimitNewRequest() {
 long newCount = requestCount.incrementAndGet();
 long msNow = System.currentTimeMillis();
-if (msNow - msCycleBegin > CYCLE_LENGTH) {
+//时间跳变(9/21->9/20)会导致本不该拒绝的请求被拒绝
+if (msNow - msCycleBegin > CYCLE_LENGTH || msNow < msCycleBegin) {
   // 新周期
   // 会有多线程竞争,互相覆盖的问题,不过无所谓,不会有什么后果
   lastRequestCount = newCount;


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-21 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16623135#comment-16623135
 ] 

ASF GitHub Bot commented on SCB-932:


laijianbin opened a new pull request #921: [SCB-932]Time jump cause the new 
request injected
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/921
 
 
   [SCB-932]Time jump cause the new request injected
   
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-20 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16623028#comment-16623028
 ] 

ASF GitHub Bot commented on SCB-932:


wujimin commented on a change in pull request #919: [SCB-932]Time jump cause 
the new request injected
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/919#discussion_r219376212
 
 

 ##
 File path: 
handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
 ##
 @@ -57,7 +57,8 @@ public void setQpsLimit(Integer qpsLimit) {
   public boolean isLimitNewRequest() {
 long newCount = requestCount.incrementAndGet();
 long msNow = System.currentTimeMillis();
-if (msNow - msCycleBegin > CYCLE_LENGTH) {
+//时间跳变(9/21->9/20)会导致本不该拒绝的请求被拒绝
 
 Review comment:
   new code comments better to be english


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-20 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16623010#comment-16623010
 ] 

ASF GitHub Bot commented on SCB-932:


coveralls commented on issue #919: [SCB-932]Time jump cause the new request 
injected
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/919#issuecomment-423401348
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/19116613/badge)](https://coveralls.io/builds/19116613)
   
   Coverage decreased (-0.004%) to 86.203% when pulling 
**74f11ff8e0aa503613080691ccd6fc36361d9df4 on laijianbin:patch-6** into 
**20627dd0af924dcdf51fe529afe49e51864dc18c on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-20 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16622994#comment-16622994
 ] 

ASF GitHub Bot commented on SCB-932:


coveralls commented on issue #918: 【SCB-932】Time jump cause the new request 
injected
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/918#issuecomment-423398318
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/19116456/badge)](https://coveralls.io/builds/19116456)
   
   Coverage remained the same at 86.207% when pulling 
**4d537c8af63ac0fb6fa051670870687dc33f3a3d on laijianbin:patch-4** into 
**20627dd0af924dcdf51fe529afe49e51864dc18c on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-20 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16622995#comment-16622995
 ] 

ASF GitHub Bot commented on SCB-932:


laijianbin opened a new pull request #919: [SCB-932]Time jump cause the new 
request injected
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/919
 
 
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-20 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16622991#comment-16622991
 ] 

ASF GitHub Bot commented on SCB-932:


laijianbin commented on issue #918: 【SCB-932】Time jump cause the new request 
injected
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/918#issuecomment-423398044
 
 
   Using  msNow < msCycleBegin  more reasonable


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-20 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16622988#comment-16622988
 ] 

ASF GitHub Bot commented on SCB-932:


laijianbin closed pull request #918: 【SCB-932】Time jump cause the new request 
injected
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/918
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
 
b/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
index 8bc147b8c..8ca7dc648 100644
--- 
a/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
+++ 
b/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
@@ -57,7 +57,8 @@ public void setQpsLimit(Integer qpsLimit) {
   public boolean isLimitNewRequest() {
 long newCount = requestCount.incrementAndGet();
 long msNow = System.currentTimeMillis();
-if (msNow - msCycleBegin > CYCLE_LENGTH) {
+//时间跳变(9/21->9/20)会导致本不该拒绝的请求被拒绝
+if (msNow - msCycleBegin > CYCLE_LENGTH || msNow - msCycleBegin < 
-CYCLE_LENGTH) {
   // 新周期
   // 会有多线程竞争,互相覆盖的问题,不过无所谓,不会有什么后果
   lastRequestCount = newCount;


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-20 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16622980#comment-16622980
 ] 

ASF GitHub Bot commented on SCB-932:


laijianbin commented on issue #918: 【SCB-932】Time jump cause the new request 
injected
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/918#issuecomment-423395166
 
 
   
   ![time 
jump](https://user-images.githubusercontent.com/26161527/45857190-35c46500-bd8a-11e8-9da4-5da256008960.png)
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-932) Time jump cause the new request injected

2018-09-20 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SCB-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16622979#comment-16622979
 ] 

ASF GitHub Bot commented on SCB-932:


laijianbin opened a new pull request #918: 【SCB-932】Time jump cause the new 
request injected
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/918
 
 
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Time jump cause the new request injected
> 
>
> Key: SCB-932
> URL: https://issues.apache.org/jira/browse/SCB-932
> Project: Apache ServiceComb
>  Issue Type: Task
>Reporter: laijianbin
>Assignee: laijianbin
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)