Skip to content

Commit 075a822

Browse files
authored
mirai 2.5.2
1 parent a767644 commit 075a822

File tree

11 files changed

+31
-43
lines changed

11 files changed

+31
-43
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ jobs:
2424

2525
- uses: r-lib/actions/setup-r-dependencies@v2
2626
with:
27-
extra-packages: |
28-
any::covr
29-
any::xml2
30-
any::rlang
31-
otelsdk=?ignore-before-r=4.3.0
27+
extra-packages: any::covr, any::xml2, any::rlang
3228
needs: coverage
3329

3430
- name: Test coverage

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: mirai
33
Title: Minimalist Async Evaluation Framework for R
4-
Version: 2.5.1.9000
4+
Version: 2.5.2
55
Authors@R: c(
66
person("Charlie", "Gao", , "[email protected]", role = c("aut", "cre"),
77
comment = c(ORCID = "0000-0002-0750-061X")),

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# mirai (development version)
1+
# mirai 2.5.2
22

33
#### Updates
44

55
* The default daemons `autoexit = TRUE` behaviour has been updated for OpenTelemetry compatibility (#500).
6-
+ Introduces a 200ms grace period for processes to exit gracefully before a forceful termination.
6+
+ Introduces a 200ms grace period for processes to exit normally before a forceful termination.
77
+ The behavioural changes announced in mirai 2.4.0 are now enforced for all daemon types - eliminating a bug that previously caused this to only be applied to ephemeral daemons.
88
* OpenTelemetry span names and attributes have been upgraded to be more informative and better follow semantic conventions (#481).
99
* `require_daemons()` updates:

R/daemon.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#' The `autoexit` argument governs persistence settings for the daemon. The
6262
#' default `TRUE` ensures that it exits as soon as its socket connection with
6363
#' the host process drops. A 200ms grace period allows the daemon process to
64-
#' exit gracefully, after which it will be forcefully terminated.
64+
#' exit normally, after which it will be forcefully terminated.
6565
#'
6666
#' Supplying `NA` ensures that a daemon always exits cleanly after its socket
6767
#' connection with the host drops. This means that it can temporarily outlive

R/otel.R

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@ otel_tracer_name <- "org.r-lib.mirai"
22
otel_is_tracing <- FALSE
33
otel_tracer <- NULL
44

5+
# generic otel helpers ---------------------------------------------------------
6+
57
# nocov start
68
# tested implicitly on package load
79

8-
otel_cache_tracer = function() {
10+
otel_cache_tracer <- function() {
911
requireNamespace("otel", quietly = TRUE) || return()
1012
otel_tracer <<- otel::get_tracer(otel_tracer_name)
1113
otel_is_tracing <<- tracer_enabled(otel_tracer)
1214
}
1315

1416
# nocov end
1517

18+
tracer_enabled <- function(tracer) {
19+
.subset2(tracer, "is_enabled")()
20+
}
21+
1622
otel_refresh_tracer <- function(pkgname) {
1723
requireNamespace("otel", quietly = TRUE) || return()
1824
tracer <- otel::get_tracer()
@@ -22,16 +28,14 @@ otel_refresh_tracer <- function(pkgname) {
2228
)
2329
}
2430

25-
tracer_enabled <- function(tracer) {
26-
.subset2(tracer, "is_enabled")()
27-
}
28-
2931
modify_binding <- function(env, lst) {
3032
lapply(names(lst), unlockBinding, env)
3133
list2env(lst, envir = env)
3234
lapply(names(lst), lockBinding, env)
3335
}
3436

37+
# mirai-specific helpers -------------------------------------------------------
38+
3539
otel_active_span <- function(
3640
name,
3741
cond = TRUE,
@@ -55,13 +59,11 @@ otel_active_span <- function(
5559
}
5660

5761
otel_set_span_id <- function(span, id) {
58-
otel_is_tracing || return()
59-
span$set_attribute("mirai.id", id)
62+
otel_is_tracing && return(span$set_attribute("mirai.id", id))
6063
}
6164

6265
otel_set_span_error <- function(span, type) {
63-
otel_is_tracing && length(span) || return()
64-
span$set_status("error", type)
66+
otel_is_tracing && length(span) && return(span$set_status("error", type))
6567
}
6668

6769
otel_daemon_attrs <- function(url) {

README.Rmd

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ knitr::opts_chunk$set(
2121
[![R-universe status](https://r-lib.r-universe.dev/badges/mirai)](https://r-lib.r-universe.dev/mirai)
2222
[![R-CMD-check](https://github.com/r-lib/mirai/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/mirai/actions/workflows/R-CMD-check.yaml)
2323
[![Codecov test coverage](https://codecov.io/gh/r-lib/mirai/graph/badge.svg)](https://app.codecov.io/gh/r-lib/mirai)
24-
[![DOI](https://zenodo.org/badge/459341940.svg)](https://doi.org/10.5281/zenodo.7912722)
2524
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/r-lib/mirai)
2625
<!-- badges: end -->
2726

@@ -84,12 +83,12 @@ daemons(0)
8483
**Dynamic Architecture**
8584

8685
- Inverted topology, where daemons connect to host, enables true dynamic scaling
87-
- Optimal load balancing through FIFO dispatcher scheduling
88-
- Event-driven promises complete with zero latency and no polling overhead
86+
- Optimal load balancing through efficient FIFO dispatcher scheduling
87+
- Event-driven promises complete with zero latency (and no polling overhead)
8988

9089
**Modern Foundation**
9190

92-
- Built on [NNG](https://nng.nanomsg.org/) via [nanonext](https://nanonext.r-lib.org/) for scaling to millions of tasks over thousands of processes
91+
- Built on [NNG](https://nng.nanomsg.org/) via [nanonext](https://nanonext.r-lib.org/), scales reliably to millions of tasks / thousands of processes
9392
- High performance, with round-trip times measured in microseconds, not milliseconds
9493
- Native support for IPC, TCP, and zero-config TLS with automatic certificate generation
9594

@@ -103,7 +102,7 @@ daemons(0)
103102

104103
- Local, network / cloud (via SSH, SSH tunnelling) or HPC (via Slurm, SGE, PBS, LSF)
105104
- Modular compute profiles direct tasks to the most suitable resources
106-
- Flexibility to combine local, remote, and HPC resources in a single compute profile
105+
- Combine local, remote, and HPC resources in a single compute profile
107106

108107
### Powers the R Ecosystem
109108

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ status](https://r-lib.r-universe.dev/badges/mirai)](https://r-lib.r-universe.dev
1212
[![R-CMD-check](https://github.com/r-lib/mirai/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/mirai/actions/workflows/R-CMD-check.yaml)
1313
[![Codecov test
1414
coverage](https://codecov.io/gh/r-lib/mirai/graph/badge.svg)](https://app.codecov.io/gh/r-lib/mirai)
15-
[![DOI](https://zenodo.org/badge/459341940.svg)](https://doi.org/10.5281/zenodo.7912722)
1615
[![Ask
1716
DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/r-lib/mirai)
1817
<!-- badges: end -->
@@ -77,15 +76,15 @@ daemons(0)
7776

7877
- Inverted topology, where daemons connect to host, enables true dynamic
7978
scaling
80-
- Optimal load balancing through FIFO dispatcher scheduling
81-
- Event-driven promises complete with zero latency and no polling
82-
overhead
79+
- Optimal load balancing through efficient FIFO dispatcher scheduling
80+
- Event-driven promises complete with zero latency (and no polling
81+
overhead)
8382

8483
**Modern Foundation**
8584

8685
- Built on [NNG](https://nng.nanomsg.org/) via
87-
[nanonext](https://nanonext.r-lib.org/) for scaling to millions of
88-
tasks over thousands of processes
86+
[nanonext](https://nanonext.r-lib.org/), scales reliably to millions
87+
of tasks / thousands of processes
8988
- High performance, with round-trip times measured in microseconds, not
9089
milliseconds
9190
- Native support for IPC, TCP, and zero-config TLS with automatic
@@ -105,8 +104,7 @@ daemons(0)
105104
- Local, network / cloud (via SSH, SSH tunnelling) or HPC (via Slurm,
106105
SGE, PBS, LSF)
107106
- Modular compute profiles direct tasks to the most suitable resources
108-
- Flexibility to combine local, remote, and HPC resources in a single
109-
compute profile
107+
- Combine local, remote, and HPC resources in a single compute profile
110108

111109
### Powers the R Ecosystem
112110

cran-comments.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
## R CMD check results
22

33
0 errors | 0 warnings | 0 notes
4-
5-
## revdepcheck results
6-
7-
We checked 33 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.
8-
9-
* We saw 0 new problems
10-
* We failed to check 3 packages

dev/vignettes/_v05-opentelemetry.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ This enables detailed monitoring of:
3232

3333
Tracing is automatically enabled when:
3434

35-
1. The `otel` and `otelsdk` packages are installed and available
35+
1. The `otel` and `otelsdk` packages are installed; and
3636
2. OpenTelemetry tracing is configured and enabled (see <https://otelsdk.r-lib.org/reference/collecting.html>)
3737

38-
No additional configuration is required - mirai will automatically detect the presence of OpenTelemetry and begin tracing.
38+
No additional action is required - mirai will automatically detect the presence of OpenTelemetry and begin tracing.
3939

4040
### 3. Span Types and Hierarchy
4141

man/daemon.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)