Skip to content
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

use Popen communicate instead of wait #25

Closed
wants to merge 2 commits into from

Conversation

schmidax
Copy link
Contributor

@schmidax schmidax commented Mar 6, 2024

Like described in this (https://stackoverflow.com/a/39477247) stackoverflow comment, it is not a good idea to use wait, because it can end up in a deadlock. This can also fix the problem in this issue https://forum.checkmk.com/t/checkmk-k8s-node-metrics-collector/43278

Like described in this (https://stackoverflow.com/a/39477247) stackoverflow comment, it is not a good idea to use wait, because it can andup in a deadlock. This can also fix the problem in this issue https://forum.checkmk.com/t/checkmk-k8s-node-metrics-collector/43278
Copy link

github-actions bot commented Mar 6, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@schmidax
Copy link
Contributor Author

schmidax commented Mar 6, 2024

I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.

@sedadas
Copy link

sedadas commented Mar 21, 2024

Hello, we are also hitting this issue on OpenShift 4.13.34. Can I assist somehow to get this merged quicker?

@SoloJacobs
Copy link
Contributor

Hi,

the component owner for this part of our software is currently not here. This does not keep me from assisting you with the change itself. However, there won't be a release until he is back.

For the change itself, I have the following question: We are moving the buffering problem from OS pipe to the memory of the process. Can we get an idea of the size of your OS pipe, and additionally the size of the out variable.

If we decide the merge these changes as is, then there are two smaller issues:

src/checkmk_kube_agent/send_metrics.py:377:11: E0602: Undefined variable 'returncode' (undefined-variable)
src/checkmk_kube_agent/send_metrics.py:376:14: W0612: Unused variable 'err' (unused-variable)

I would squash the commits into one, and replace err by _err.

@schmidax
Copy link
Contributor Author

schmidax commented Apr 3, 2024

Hi,

the max OS pipe buffer is 64kB. However, with the Kubernetes clusters I am using, the size of the out variable exceeds 126kB. This causes the script to deadlock.

I would squash the commits into one, and replace err by _err.

Yes ok, that's good

@SoloJacobs
Copy link
Contributor

Alright seems good to me. One more person will review it, then we'll test some changes in a live scenario, and finally include it in the next release (I'll post an update).

I've rebase this commit on the other pull request, squash the two commits into one. This is to avoid our internal tooling from complaining about the errors I mentioned above.

@CheckmkCI CheckmkCI closed this in 5a996e6 Apr 5, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 5, 2024
CheckmkCI pushed a commit that referenced this pull request Apr 8, 2024
CMK-16676

Closes: #25

Change-Id: Ib43aea1b83cf1fc28d617bedd76656aa77bdac78
@SoloJacobs
Copy link
Contributor

Hi,

the release is now available https://github.com/Checkmk/checkmk_kube_agent/releases/tag/v1.6.0
Thank you for your contribution!

Kind regards, Sol

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants