-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix get_logs pod_names type and iteration blocking #1280
Conversation
Hi @Windfarer. Thanks for your PR. I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why the fix is needed and update PR title/description?
Sorry about the not detailed description. The return value of method |
@terrytangyuan I've updated the commits as well as the description, this PR is ready for review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Windfarer: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/lgtm
/approve
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: terrytangyuan The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The CI fails because of #1277 I am merging it manually. |
There are 2 issues in current code.
pod_names
is not subscriptableThe return value of method self.get_pod_names is a "set" type, so that the following code pod_names[index] for getting the pod's name with index number will raise an exception
TypeError: 'set' object is not subscriptable
, so we should convertpod_names
to list.iterate over multiple generators(the return value of watch.stream()) may be blocked on one generator
We iterate over these streams, but when one pod not to produce new log, the iteration process will block on this stream and cannot continue to read other pods' stream. To fix this, we should create queues for every stream and start one thread for every stream for decoupling the logs' producing and consuming, so that we can implement non-blocking iterations over every streams.
I've tested this changed code on my kubeflow cluster, and it works well.