Closed clearday4 closed 3 months ago
That's the only way to do it, since no data is sent if there are no events, the only other way to detect it is via a TCP timeout, but that's not currently supported.
We could consider adding support for that via: https://curl.se/libcurl/c/CURLOPT_TCP_KEEPALIVE.html
cc @ityuhui
my questions are as follows. If I call the API with watch option, curl_easy_perform should have already returned, so how do I know that the TCP connection has been lost? If I could know by the result of curl_easy_perform(), it doesn't make sense for the watch behavior. I think I need to check via callback function. Is it possible to check if TCP is disconnected using CURLOPT_XFERINFOFUNCTION?
We already support CURLOPT_XFERINFOFUNCTION
via progress_func
You can have a try.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/reopen
/remove-lifecycle rotten
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
Hello
I'd like to distinguish between no events from the API server during the watch behavior and a disconnected libcurl. If the API server is disconnected, I have to re-run the watch function.
In the current code, the only way to perform a periodic watch with a timeout, which means that I'll not receive notification from the API server for a worst-case timeout. I was hoping you could help me figure out what to do fix this.
Thanks in advance.