[jira] [Commented] (SCB-688) vertx rest server not accept too many connection
[ https://issues.apache.org/jira/browse/SCB-688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16571604#comment-16571604 ] ASF GitHub Bot commented on SCB-688: liubao68 closed pull request #852: [SCB-688] vertx rest server not accept too many connection URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/852 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/core/src/main/java/org/apache/servicecomb/core/Const.java b/core/src/main/java/org/apache/servicecomb/core/Const.java index 08fcf7c6a..e46cc820a 100644 --- a/core/src/main/java/org/apache/servicecomb/core/Const.java +++ b/core/src/main/java/org/apache/servicecomb/core/Const.java @@ -27,6 +27,8 @@ private Const() { public static final String RESTFUL = "rest"; + public static final String HIGHWAY = "highway"; + public static final String ANY_TRANSPORT = ""; public static final String VERSION_RULE_LATEST = DefinitionConst.VERSION_RULE_LATEST; diff --git a/core/src/main/java/org/apache/servicecomb/core/Transport.java b/core/src/main/java/org/apache/servicecomb/core/Transport.java index ed9ade43e..026ed7c4e 100644 --- a/core/src/main/java/org/apache/servicecomb/core/Transport.java +++ b/core/src/main/java/org/apache/servicecomb/core/Transport.java @@ -17,6 +17,8 @@ package org.apache.servicecomb.core; +import java.util.concurrent.atomic.AtomicInteger; + import org.apache.servicecomb.swagger.invocation.AsyncResponse; // TODO:感觉要拆成显式的client、server才好些 @@ -49,4 +51,6 @@ default boolean canInit() { Endpoint getPublishEndpoint() throws Exception; void send(Invocation invocation, AsyncResponse asyncResp) throws Exception; + + AtomicInteger getConnectedCounter(); } diff --git a/core/src/main/java/org/apache/servicecomb/core/transport/AbstractTransport.java b/core/src/main/java/org/apache/servicecomb/core/transport/AbstractTransport.java index d75570ec5..ff5370afd 100644 --- a/core/src/main/java/org/apache/servicecomb/core/transport/AbstractTransport.java +++ b/core/src/main/java/org/apache/servicecomb/core/transport/AbstractTransport.java @@ -23,6 +23,7 @@ import java.net.URLDecoder; import java.nio.charset.StandardCharsets; import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import org.apache.http.client.utils.URLEncodedUtils; @@ -65,6 +66,8 @@ protected Endpoint publishEndpoint; + private final AtomicInteger connectedCounter = new AtomicInteger(0); + @Override public Endpoint getPublishEndpoint() { return publishEndpoint; @@ -75,6 +78,11 @@ public Endpoint getEndpoint() { return endpoint; } + @Override + public AtomicInteger getConnectedCounter() { +return connectedCounter; + } + protected void setListenAddressWithoutSchema(String addressWithoutSchema) { setListenAddressWithoutSchema(addressWithoutSchema, null); } diff --git a/core/src/test/java/org/apache/servicecomb/core/TestTransport.java b/core/src/test/java/org/apache/servicecomb/core/TestTransport.java index c1bca1f79..abfa20252 100644 --- a/core/src/test/java/org/apache/servicecomb/core/TestTransport.java +++ b/core/src/test/java/org/apache/servicecomb/core/TestTransport.java @@ -21,6 +21,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; import org.apache.servicecomb.core.endpoint.EndpointsCache; import org.apache.servicecomb.core.transport.TransportManager; @@ -43,7 +44,12 @@ public void testEndpoint() throws Exception { Endpoint oEndpoint = new Endpoint(new Transport() { @Override - public void send(Invocation invocation, AsyncResponse asyncResp) throws Exception { + public void send(Invocation invocation, AsyncResponse asyncResp) { + } + + @Override + public AtomicInteger getConnectedCounter() { +return new AtomicInteger(0); } @Override @@ -52,7 +58,7 @@ public Object parseAddress(String address) { } @Override - public boolean init() throws Exception { + public boolean init() { return true; } @@ -67,7 +73,7 @@ public Endpoint getEndpoint() { } @Override - public Endpoint getPublishEndpoint() throws Exception { + public Endpoint getPublishEndpoint() { return (new Endpoint(this, "testEndpoint")); } }, "rest://127.0.0.1:8080"); @@ -75,14 +81,13 @@ public Endpoint getPublishEndpoint() throws Exception { Assert.assertEquals("rest://127.0.0.1:8080", oEndpoint.getEndpoint()); Assert.assertEquals("127.0.0.1", oEndpoint.getAddress()); Assert.assertEquals("test",
[jira] [Commented] (SCB-688) vertx rest server not accept too many connection
[ https://issues.apache.org/jira/browse/SCB-688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16570004#comment-16570004 ] ASF GitHub Bot commented on SCB-688: coveralls edited a comment on issue #852: [SCB-688] vertx rest server not accept too many connection URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/852#issuecomment-410120393 [![Coverage Status](https://coveralls.io/builds/18340454/badge)](https://coveralls.io/builds/18340454) Coverage increased (+0.09%) to 85.169% when pulling **77025063b3f217ee5f2235e41365ec1c1bf83b9d on zhengyangyong:SCB-688** into **ebff3ee49384e78a4210291702f13ff357acd671 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 > vertx rest server not accept too many connection > > > Key: SCB-688 > URL: https://issues.apache.org/jira/browse/SCB-688 > Project: Apache ServiceComb > Issue Type: Sub-task > Components: Java-Chassis >Reporter: wujimin >Assignee: yangyongzheng >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-688) vertx rest server not accept too many connection
[ https://issues.apache.org/jira/browse/SCB-688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16569807#comment-16569807 ] ASF GitHub Bot commented on SCB-688: coveralls edited a comment on issue #852: [SCB-688] vertx rest server not accept too many connection URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/852#issuecomment-410120393 [![Coverage Status](https://coveralls.io/builds/18337864/badge)](https://coveralls.io/builds/18337864) Coverage increased (+0.09%) to 85.171% when pulling **f5d3d7c0a6008fccac7a46183278c6acd7bb4c8c on zhengyangyong:SCB-688** into **ebff3ee49384e78a4210291702f13ff357acd671 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 > vertx rest server not accept too many connection > > > Key: SCB-688 > URL: https://issues.apache.org/jira/browse/SCB-688 > Project: Apache ServiceComb > Issue Type: Sub-task > Components: Java-Chassis >Reporter: wujimin >Assignee: yangyongzheng >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-688) vertx rest server not accept too many connection
[ https://issues.apache.org/jira/browse/SCB-688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16569671#comment-16569671 ] ASF GitHub Bot commented on SCB-688: zhengyangyong commented on a change in pull request #852: [SCB-688] vertx rest server not accept too many connection URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/852#discussion_r207763003 ## File path: foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/ClientEvent.java ## @@ -20,21 +20,35 @@ /** * Notice: this event will raised in vertx eventloop thread, so do not run any block code */ -public class ClientClosedEvent { +public class ClientEvent { private final String address; + private final EventType eventType; + + private final ServerType serverType; + private final int totalConnectedCount; public String getAddress() { return address; } + public EventType getEventType() { +return eventType; + } + + public ServerType getServerType() { +return serverType; + } + public int getTotalConnectedCount() { return totalConnectedCount; } - public ClientClosedEvent(String address, int totalConnectedCount) { + public ClientEvent(String address, EventType eventType, ServerType serverType, int totalConnectedCount) { Review comment: that's great,thanks, done. 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 > vertx rest server not accept too many connection > > > Key: SCB-688 > URL: https://issues.apache.org/jira/browse/SCB-688 > Project: Apache ServiceComb > Issue Type: Sub-task > Components: Java-Chassis >Reporter: wujimin >Assignee: yangyongzheng >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-688) vertx rest server not accept too many connection
[ https://issues.apache.org/jira/browse/SCB-688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16569654#comment-16569654 ] ASF GitHub Bot commented on SCB-688: liubao68 commented on a change in pull request #852: [SCB-688] vertx rest server not accept too many connection URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/852#discussion_r207760722 ## File path: foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/ClientEvent.java ## @@ -20,21 +20,35 @@ /** * Notice: this event will raised in vertx eventloop thread, so do not run any block code */ -public class ClientClosedEvent { +public class ClientEvent { private final String address; + private final EventType eventType; + + private final ServerType serverType; + private final int totalConnectedCount; public String getAddress() { return address; } + public EventType getEventType() { +return eventType; + } + + public ServerType getServerType() { +return serverType; + } + public int getTotalConnectedCount() { return totalConnectedCount; } - public ClientClosedEvent(String address, int totalConnectedCount) { + public ClientEvent(String address, EventType eventType, ServerType serverType, int totalConnectedCount) { Review comment: I'd prefer ClientEvent -> ConnectionEvent & ServerType -> TransportType, how do you think? 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 > vertx rest server not accept too many connection > > > Key: SCB-688 > URL: https://issues.apache.org/jira/browse/SCB-688 > Project: Apache ServiceComb > Issue Type: Sub-task > Components: Java-Chassis >Reporter: wujimin >Assignee: yangyongzheng >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-688) vertx rest server not accept too many connection
[ https://issues.apache.org/jira/browse/SCB-688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16567680#comment-16567680 ] ASF GitHub Bot commented on SCB-688: coveralls commented on issue #852: [SCB-688] vertx rest server not accept too many connection URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/852#issuecomment-410120393 [![Coverage Status](https://coveralls.io/builds/18304619/badge)](https://coveralls.io/builds/18304619) Coverage increased (+0.09%) to 85.175% when pulling **234253c0fe5c2179df712645d0f7e64e8b46e164 on zhengyangyong:SCB-688** into **ebff3ee49384e78a4210291702f13ff357acd671 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 > vertx rest server not accept too many connection > > > Key: SCB-688 > URL: https://issues.apache.org/jira/browse/SCB-688 > Project: Apache ServiceComb > Issue Type: Sub-task > Components: Java-Chassis >Reporter: wujimin >Assignee: yangyongzheng >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-688) vertx rest server not accept too many connection
[ https://issues.apache.org/jira/browse/SCB-688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16566460#comment-16566460 ] ASF GitHub Bot commented on SCB-688: zhengyangyong opened a new pull request #852: [SCB-688] vertx rest server not accept too many connection URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/852 Signed-off-by: zhengyangyong 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). --- Add `servicecomb.rest.server.connection-limit` for setting this limit Default value is Integer.MAX_VALUE https://github.com/eclipse/vert.x/issues/2542 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 > vertx rest server not accept too many connection > > > Key: SCB-688 > URL: https://issues.apache.org/jira/browse/SCB-688 > Project: Apache ServiceComb > Issue Type: Sub-task > Components: Java-Chassis >Reporter: wujimin >Assignee: yangyongzheng >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)