dh-cloud commented on PR #2915:
URL: https://github.com/apache/tinkerpop/pull/2915#issuecomment-2518918920

   > Based on information that I've recently read (which could be inaccurate), 
I think the `SO_KEEPALIVE` option and the `IdleTimeoutHandler` can be used 
together. TCP probes shouldn't be surfaced by `recv()` so it shouldn't reset 
the idle timer. If this can be confirmed (via a small test), then I think its 
probably OK to just add the `SO_KEEPALIVE` option regardless of whether the 
idle monitor is supported.
   > 
   > That being said, I'm still a bit skeptical about the real-world usefulness 
of this PR given that Netty can't control things like keepalive period and so 
on as those require OS-level options to be set. This just ends up using OS 
defaults which users may or may not find useful. So while I still support 
merging this PR, I think it will ultimately be replaced by the idle monitor.
   > 
   > Again, it would great if you could confirm that setting this option 
doesn't affect the idle monitor, in which case, you can just always have this 
option on.
   
   Regarding the scenario of using `SO_KEEPALIVE` and `IdleTimeoutHandler` 
together, I have conducted a small test. The results show that `SO_KEEPALIVE` 
does not interfere with `IdleTimeoutHandler` resetting the idle timer. I also 
studied the source code of IdleTimeoutHandler and related TCP KEEPALIVE 
documentation. Based on my understanding, as you mentioned, the `SO_KEEPALIVE` 
feature is a mechanism of the underlying operating system's TCP, and the 
application layer Netty does not perceive it, so it does not affect 
IdleTimeoutHandler. My test steps are as follows:
   
   1. In the gremlin-server.yaml configuration file, set 
`settings.keepAliveInterval` to 60 seconds.
   2. Create a client that connects to the gremlin-server using a long-lived 
connection, without actively releasing the connection, to simulate an idle 
connection scenario.
   3. Observe the time intervals of the `WRITER_IDLE` event logs printed by the 
gremlin-server. The entire observation period was 8 hours. The results show 
that the `WRITER_IDLE` event was printed 60 * 8 = 480 times, with a print 
interval of 60 seconds.
   
   In short, `SO_KEEPALIVE` does not affect IdleTimeoutHandler.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to