tinkerpop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stephen mallette (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (TINKERPOP-1351) Number of connections going beyond the pool max size
Date Wed, 13 Jul 2016 20:22:20 GMT

     [ https://issues.apache.org/jira/browse/TINKERPOP-1351?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

stephen mallette closed TINKERPOP-1351.
---------------------------------------
    Resolution: Fixed

> Number of connections going beyond the pool max size
> ----------------------------------------------------
>
>                 Key: TINKERPOP-1351
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1351
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: driver
>    Affects Versions: 3.1.2-incubating
>         Environment: RESTful web service using gremlin driver to send request to a Gremlin
Server
>            Reporter: Ramzi Oueslati
>            Assignee: stephen mallette
>             Fix For: 3.1.3, 3.2.1
>
>
> When the gremlin driver is used with an important number of concurrent requests, sockets
are opened far beyond the max pool size.
> At some point, the connections are destroyed, the pool is empty and then the borrowConnection
process goes through :
> {code:java}
>         if (connections.isEmpty()) {
>             logger.debug("Tried to borrow connection but the pool was empty for {} -
scheduling pool creation and waiting for connection", host);
>             for (int i = 0; i < minPoolSize; i++) {
>                 scheduledForCreation.incrementAndGet();
>                 newConnection();
>             }
>             return waitForConnection(timeout, unit);
>         }
> {code}
> If many connections are borrowed at the same time then this code will schedule as many
connections for creation.
> I added a check :
> {code:java}
>             for (int i = 0; i < minPoolSize; i++) {
>                 if (scheduledForCreation.get() < minPoolSize) {
>                     scheduledForCreation.incrementAndGet();
>                     logger.debug("borrowConnection: [inc] scheduledForCreation=" + scheduledForCreation.get());
>                     newConnection();
>                 }
>             }
> {code}
> It seems to solve the problem.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message