Skip to content

Commit 64d96a8

Browse files
authored
Merge pull request #918 from simvue-io/hotfix/metric_size_limits
Hotfix: Metric size limits
2 parents 4877133 + ac94826 commit 64d96a8

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Change Log
22

3-
## [v2.3.4](https://github.com/simvue-io/python-api/releases/tag/v2.3.4) - 2026-02-10
3+
## [v2.3.4](https://github.com/simvue-io/python-api/releases/tag/v2.3.4) - 2026-02-11
44

55
- Add handling of metrics based on size and enforce 10k points per grid metric as per server.
66
- Freeze `flatdict==4.0.0` do address install issues.

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ keywords:
4343
- simulation
4444
license: Apache-2.0
4545
commit: a24e113aeb6091399cffa0166dd17d1bae0ed916
46-
version: 2.3.3
47-
date-released: '2026-02-10'
46+
version: 2.3.4
47+
date-released: '2026-02-11'

simvue/run.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979

8080
HEARTBEAT_INTERVAL: int = 60
8181
RESOURCES_METRIC_PREFIX: str = "resources"
82+
TOTAL_GRID_METRIC_SIZE: int = 1e6
8283
MAXIMUM_GRID_METRIC_SIZE: int = 5 * 10**4
8384

8485
logger = logging.getLogger(__name__)
@@ -547,7 +548,7 @@ def _start(self) -> bool:
547548
mode=self._dispatch_mode,
548549
termination_trigger=self._shutdown_event,
549550
object_types=["events", "metrics_regular", "metrics_tensor"],
550-
thresholds=dict(object_size=MAXIMUM_GRID_METRIC_SIZE),
551+
thresholds=dict(object_size=TOTAL_GRID_METRIC_SIZE),
551552
callback=self._create_dispatch_callback(),
552553
)
553554

@@ -584,12 +585,6 @@ def _error(self, message: str, join_threads: bool = True) -> None:
584585
RuntimeError
585586
exception throw
586587
"""
587-
# Stop heartbeat
588-
if self._heartbeat_termination_trigger and self._heartbeat_thread:
589-
self._heartbeat_termination_trigger.set()
590-
if join_threads:
591-
self._heartbeat_thread.join()
592-
593588
# Finish stopping all threads
594589
if self._shutdown_event:
595590
self._shutdown_event.set()
@@ -600,6 +595,12 @@ def _error(self, message: str, join_threads: bool = True) -> None:
600595
if join_threads:
601596
self._dispatcher.join()
602597

598+
# Stop heartbeat
599+
if self._heartbeat_termination_trigger and self._heartbeat_thread:
600+
self._heartbeat_termination_trigger.set()
601+
if join_threads:
602+
self._heartbeat_thread.join()
603+
603604
if not self._suppress_errors:
604605
raise SimvueRunError(message)
605606

@@ -1860,10 +1861,6 @@ def set_status(
18601861
def _tidy_run(self) -> None:
18611862
self._executor.wait_for_completion()
18621863

1863-
if self._heartbeat_thread and self._heartbeat_termination_trigger:
1864-
self._heartbeat_termination_trigger.set()
1865-
self._heartbeat_thread.join()
1866-
18671864
if self._shutdown_event:
18681865
self._shutdown_event.set()
18691866

@@ -1876,6 +1873,10 @@ def _tidy_run(self) -> None:
18761873
self._dispatcher.purge()
18771874
self._dispatcher.join()
18781875

1876+
if self._heartbeat_thread and self._heartbeat_termination_trigger:
1877+
self._heartbeat_termination_trigger.set()
1878+
self._heartbeat_thread.join()
1879+
18791880
if (
18801881
self._sv_obj
18811882
and self._user_config.run.mode == "offline"

0 commit comments

Comments
 (0)