Closed (fixed)
Project:
Cloud
Version:
3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
24 Jul 2020 at 19:56 UTC
Updated:
7 Aug 2020 at 22:19 UTC
Jump to comment: Most recent, Most recent file
In both these functions, if the k8s_node is dirty, it will call the K8s service and attempt to update them.
foreach ($nodes ?: [] as $node) {
if (k8s_is_metrics_enabled($node->getCloudContext()) === TRUE) {
if ($node->getDirty()) {
$this->k8sService->setCloudContext($node->getCloudContext());
$this->k8sService->updateNodesWithoutBatch([
'metadata.name' => $node->getName(),
], FALSE);
}
$pod_resources = $this->getPodResources($node->getName());
// Return a JSON object of K8s Node names, Pods capacity and Pods
// allocation to construct a Node heatmap to display the Pods allocation
// status by D3.js.
$node_response = $this->generateNodeResponse($node);
$node_response['pods'] = $pod_resources;
$response[] = $node_response;
}
}
Since these functions are mainly used for the K8s graph blocks, attempting to update nodes can delay the rendering of graphs.
This should be removed. Dirty node updating should happen in Cron and the Queue.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3161340-2.patch | 7.81 KB | baldwinlouie |
Comments
Comment #2
baldwinlouie commentedComment #3
baldwinlouie commentedAttaching patch that removes the updating of dirty nodes. Cron already takes care of updating all nodes.
Comment #4
yas@baldwinlouie
Thank you for the refactoring. I tested the patch and it looks good to me. I'll merge the patch to
8.x-1.x,8.x-2.xand3.xand close this issue asFixed.Comment #7
yas