Skip to content

Commit 8f4c778

Browse files
author
clearml
committed
Fix regression issue AttributeError: 'NoneType' object has no attribute 'pending' caused by accessing a non-existing report
1 parent 95bbafc commit 8f4c778

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

clearml_agent/helper/resource_monitor.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ def get_cluster_key_and_resource_group(self, worker_id: str):
221221
return cluster_key, resource_group
222222

223223
def _create_cluster_report(
224-
self, worker_id=None, cluster_key=None, max_gpus=None, max_workers=None, resource_groups=None
224+
self, worker_id=None, cluster_key=None, max_gpus=None, max_workers=None, resource_groups=None, pending=False
225225
):
226-
# type: (Optional[str], Optional[str], Optional[int], Optional[int], Optional[List[str]]) -> ()
226+
# type: (Optional[str], Optional[str], Optional[int], Optional[int], Optional[List[str]], bool) -> ()
227227
"""
228228
Set up a cluster report for the enterprise server dashboard feature.
229229
If a worker_id is provided, cluster_key and resource_groups are inferred from it.
@@ -247,7 +247,8 @@ def _create_cluster_report(
247247
cluster_key=cluster_key,
248248
max_gpus=max_gpus,
249249
max_workers=max_workers,
250-
resource_groups=resource_groups
250+
resource_groups=resource_groups,
251+
pending=pending,
251252
)
252253
except Exception as ex:
253254
print("Error: failed setting cluster report: {}".format(ex))
@@ -278,9 +279,9 @@ def setup_daemon_cluster_report(self, worker_id=None, cluster_key=None, max_work
278279
worker_id=worker_id,
279280
cluster_key=cluster_key,
280281
max_workers=max_workers,
281-
resource_groups=resource_groups
282+
resource_groups=resource_groups,
283+
pending=True,
282284
)
283-
self._cluster_report.pending = True
284285

285286
def _daemon(self):
286287
last_cluster_report = 0

0 commit comments

Comments
 (0)