question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

watch return same event twice

See original GitHub issue

I tried amounts of ways to use the watch method, but all were hang on without any response. For example,

from kubernetes import config,client,watch
from kubernetes.client.rest import ApiException
from pprint import pprint

config.load_kube_config()
v1 = client.CoreV1Api()
try:
    response = v1.list_pod_for_all_namespaces(watch=True)
    pprint(response)
except ApiException as e:
    print("Exception: %s\n" % e)

It hangs on all the time, and if I set watch=False it would get the right response. Does anyone know what’s wrong with my code?

By the way, the example of list_pod_for_all_namespaces has a typo error, which set the watch = true.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
DjangoPengcommented, Apr 14, 2017

It works in this way below:

for e in watch.strem(v1.list_pod_for_all_namespaces):
    print(e['object'])
0reactions
DjangoPengcommented, Apr 14, 2017

@sebgoa Got it, I’ll do that next time, and I think this is not a issue actually. I would close it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Vue watch unexpectedly called twice
In my case, I have the "watch" in a component and use the component twice on the page, so the "watch" is being...
Read more >
Receiving the same events twice · Issue #840
Hi everyone,. I'm having an issue, where I receive an event twice. This behaviour only occurs on my iOS device (iPhone X with...
Read more >
Error handling and automatic retries in AWS Lambda
If you retry, ensure that your function's code can handle the same event multiple times ... Asynchronous invocation – Lambda retries function errors...
Read more >
Getting event twice, when it's called only once? - Get Help
Hello everybody,. I got the problem that an event is emitted twice somehow. I can not explain this behavior: This is my bootstrap.js:...
Read more >
Apple Watch Hermès
Apple Watch Hermès is the ultimate union of heritage and innovation, combining Apple Watch Series 8 with exclusive watch faces and a range...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found