You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/12/10 18:28:20 UTC

[GitHub] [pulsar] harissecic opened a new issue #8904: Client auto re-connect on specific idle time

harissecic opened a new issue #8904:
URL: https://github.com/apache/pulsar/issues/8904


   **Is your feature request related to a problem? Please describe.**
   Azure App Services time out after being idle for 240 seconds (4 minutes) and there's no actual way to avoid this. All connections at least in my experience get killed but not 100% sure about properly closed.
   
   **Describe the solution you'd like**
   Using clients (Java client in my case) inside such environment makes me restart manually services if there was no messages for given consumer in 4 minute time window. Would be good to have option reconnect after on building a consumer or maybe even PulsarClient in this case.
   
   **Describe alternatives you've considered**
   Could avoid using App Services. Could implement wrapping solution which "kills" the pulsar consumer if no messages have been sent in 4 minutes. This would have to be notified by the actual message listener or so on each message and have it's own internal timer. Reflection is really a poor choice even worse then previous example but could work.
   
   **Additional context**
   As usual in business sometimes we are forced to use technologies and providers that don't play well together. Pulsar is picked by choice and Azure was forced upon us by a client. So trying to report as much as possible of these niche scenarios. Neo4j client libraries had similar issues where they had to introduce the timeout for idle connections as TCP was incorrectly closed by Azure on App Service and Neo4j client though connection stayed opened so it didn't mark connection as killed or so but rather always threw exception after specific timeout for data exchange so just a heads up not to rely on TCP close handshakes.
   


----------------------------------------------------------------
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] [pulsar] harissecic edited a comment on issue #8904: Client auto re-connect on specific idle time

Posted by GitBox <gi...@apache.org>.
harissecic edited a comment on issue #8904:
URL: https://github.com/apache/pulsar/issues/8904#issuecomment-743028197


   > @harissecic
   > 
   > I didn't use Azure App Service before. But Pulsar client periodically sends heartbeats to brokers to detect if a connection is broken or not. Then it will automatically reconnect if it detects connections are broken.
   > 
   > See http://pulsar.apache.org/api/client/2.7.0-SNAPSHOT/org/apache/pulsar/client/api/ClientBuilder.html#keepAliveInterval-int-java.util.concurrent.TimeUnit-
   
   This was not the case in my services. However it could have been that the App Service didn't have configuration called Always ON enabled. In this case maybe there's no way that heartbeat would work, yet service would work if one would to make a HTTP request like GET on REST service. Now I don't fully understand what's happening in them but I will try to debug this with Always ON enabled and disabled. check the behaviour. I'm guessing it's most likely that the Always ON was by disabled and in such case I expect it not to work as Azure will shutdown service if there's no trafick going through. However this again raises the question shouldn't heartbeat from Pulsar keep this service running regardless of that feature because Pulsar would be the one sending network traffic? It will take a bit more time for me to make a test environment with Pulsar and a Java client to test this out and report back. I can assume also that it might be Azure killing off those connections for some reason l
 ike: not having web port active will shut down app regardless of other connections. Whatever it may be this is 99.9% on Azure side and a workaround would be helpful or it may be that the App Service should be avoided.


----------------------------------------------------------------
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] [pulsar] sijie commented on issue #8904: Client auto re-connect on specific idle time

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #8904:
URL: https://github.com/apache/pulsar/issues/8904#issuecomment-742942061


   @harissecic
   
   I didn't use Azure App Service before. But Pulsar client periodically sends heartbeats to brokers to detect if a connection is broken or not. Then it will automatically reconnect if it detects connections are broken.
   
   See http://pulsar.apache.org/api/client/2.7.0-SNAPSHOT/org/apache/pulsar/client/api/ClientBuilder.html#keepAliveInterval-int-java.util.concurrent.TimeUnit-


----------------------------------------------------------------
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] [pulsar] harissecic commented on issue #8904: Client auto re-connect on specific idle time

Posted by GitBox <gi...@apache.org>.
harissecic commented on issue #8904:
URL: https://github.com/apache/pulsar/issues/8904#issuecomment-743028197


   > @harissecic
   > 
   > I didn't use Azure App Service before. But Pulsar client periodically sends heartbeats to brokers to detect if a connection is broken or not. Then it will automatically reconnect if it detects connections are broken.
   > 
   > See http://pulsar.apache.org/api/client/2.7.0-SNAPSHOT/org/apache/pulsar/client/api/ClientBuilder.html#keepAliveInterval-int-java.util.concurrent.TimeUnit-
   
   This was not the case in my services. However it could have been that the App Service didn't have configuration called Always ON enabled. In this case there's no way that heartbeat would work, yet service would work if one would to make a HTTP request like GET on REST service. Now I don't fully understand what's happening in them but I will try to debug this with Always ON enabled and disabled. check the behaviour. I'm guessing it's most likely that the Always ON was by disabled and in such case I expect it not to work as Azure will shutdown service if there's no trafick going through. However this again raises the question shouldn't heartbeat from Pulsar keep this service running regardless of that feature because Pulsar would be the one sending network traffic? It will take a bit more time for me to make a test environment with Pulsar and a Java client to test this out and report back. I can assume also that it might be Azure killing off those connections for some reason like: n
 ot having web port active will shut down app regardless of other connections. Whatever it may be this is 99.9% on Azure side and a workaround would be helpful or it may be that the App Service should be avoided.


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