[ 
https://issues.apache.org/jira/browse/TINKERPOP-2807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17615150#comment-17615150
 ] 

Stephen Mallette commented on TINKERPOP-2807:
---------------------------------------------

Testing and debugging seem to indicate that the {{heartbeat}} in aiohttp is 
faulty. While I can see in the debugger that the provided configuration is 
indeed being passed to aiohttp properly and while I can see the heartbeat 
function being scheduled, it never seems to actually get triggered. There do 
not appear to be any open issues in aiohttp for this problem at this time. 

At this time, the only workaround I can think of is for clients to implement 
their own keep-alive functionality which would periodically send a query to the 
server (e.g. {{g.inject(0)}} or an empty string) to keep the connection alive. 
It's not ideal but for situation where there are long pauses in reads/writes on 
a connection that must stay open I think this approach might be the only option 
available.

> heartbeat setting to AiohttpTransport does not prevent the idle connections 
> from being closed
> ---------------------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-2807
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2807
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: driver
>    Affects Versions: 3.5.4
>            Reporter: Stephen Mallette
>            Assignee: Stephen Mallette
>            Priority: Blocker
>
> Setting {{heartbeat}} like this:
> {code}
> Client('ws://localhost:45940/gremlin', 'g', 
>     transport_factory=lambda: transport.AiohttpTransport(heartbeat=5.0))
> {code}
> should send a ping message to the server to keep the connection alive but it 
> clearly does not.  Manual testing shows Gremlin Server closing the connection 
> as idle despite this setting.
> For more information on the setting see: 
> https://docs.aiohttp.org/en/stable/client_reference.html



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to