You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/07/09 03:36:02 UTC

[GitHub] [servicecomb-java-chassis] GuoYL123 opened a new pull request #1876: [SCB-2036] fix memory leak when router pass header

GuoYL123 opened a new pull request #1876:
URL: https://github.com/apache/servicecomb-java-chassis/pull/1876


   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 -Pit` 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 to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #1876: [SCB-2036] fix memory leak when router pass header

Posted by GitBox <gi...@apache.org>.
liubao68 commented on a change in pull request #1876:
URL: https://github.com/apache/servicecomb-java-chassis/pull/1876#discussion_r451993249



##########
File path: handlers/handler-router/src/main/java/org/apache/servicecomb/router/custom/RouterInvokeFilter.java
##########
@@ -68,67 +63,34 @@ public boolean enabled() {
   @Override
   public Response afterReceiveRequest(Invocation invocation,
       HttpServletRequestEx httpServletRequestEx) {
-    if (!isHaveHeadersRule()) {
+    if (!RouterRuleCache.isServerContainRule(invocation.getMicroserviceName())) {
       return null;
     }
-    if (!RouterRuleCache.isServerContainRule(invocation.getMicroserviceName())) {
+    List<String> headerRules = loadHeaders();
+    if (headerRules == null) {
       return null;
     }
-    if (loadHeaders()) {
-      Map<String, String> headerMap = getHeaderMap(httpServletRequestEx);
-      try {
-        invocation.addContext(ROUTER_HEADER, JsonUtils.OBJ_MAPPER.writeValueAsString(headerMap));
-      } catch (JsonProcessingException e) {
-        LOGGER.error("canary context serialization failed");
-      }
+    Map<String, String> headerMap = getHeaderMap(httpServletRequestEx, headerRules);
+    try {
+      invocation.addContext(ROUTER_HEADER, JsonUtils.OBJ_MAPPER.writeValueAsString(headerMap));
+    } catch (JsonProcessingException e) {
+      LOGGER.error("router context serialization failed");
     }
     return null;

Review comment:
       This modification is not good. Try find the root cause and fixed the condition why memory leak and do not modifify the logic of dynamicy config cache. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] coveralls edited a comment on pull request #1876: [SCB-2036] fix memory leak when router pass header

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #1876:
URL: https://github.com/apache/servicecomb-java-chassis/pull/1876#issuecomment-655914199


   
   [![Coverage Status](https://coveralls.io/builds/31960749/badge)](https://coveralls.io/builds/31960749)
   
   Coverage increased (+0.02%) to 86.331% when pulling **71023d5916d8ffd8046e51c2b9603ca0e680aaed on GuoYL123:master** into **0d1af3fce70a442119fe65766f498428132a9d1e on apache:master**.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 merged pull request #1876: [SCB-2036] fix memory leak when router pass header

Posted by GitBox <gi...@apache.org>.
liubao68 merged pull request #1876:
URL: https://github.com/apache/servicecomb-java-chassis/pull/1876


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] coveralls edited a comment on pull request #1876: [SCB-2036] fix memory leak when router pass header

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #1876:
URL: https://github.com/apache/servicecomb-java-chassis/pull/1876#issuecomment-655914199


   
   [![Coverage Status](https://coveralls.io/builds/31980323/badge)](https://coveralls.io/builds/31980323)
   
   Coverage increased (+0.006%) to 86.318% when pulling **16f956d9ef9e717c5aa961a91656fdc3f9f2b864 on GuoYL123:master** into **0d1af3fce70a442119fe65766f498428132a9d1e on apache:master**.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] coveralls commented on pull request #1876: [SCB-2036] fix memory leak when router pass header

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #1876:
URL: https://github.com/apache/servicecomb-java-chassis/pull/1876#issuecomment-655914199


   
   [![Coverage Status](https://coveralls.io/builds/31957751/badge)](https://coveralls.io/builds/31957751)
   
   Coverage increased (+0.06%) to 86.368% when pulling **d36fd3f02bebcd7154622788e52a4a74d3eb8006 on GuoYL123:master** into **0d1af3fce70a442119fe65766f498428132a9d1e on apache:master**.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org