Troubles with throughput/backlog tests #138
-
Following up on shikokuchuo/nanonext#24 (comment): I just retested https://github.com/wlandau/crew/blob/46e9fd2b37d888d5f27e01c6c0aec48c0f4f551c/tests/throughput/test-backlog-tasks_max.R on my local Ubuntu machine. Using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Yup, it's also happening without TLS. The test code for that is: library(crew)
controller <- crew_controller_local(
workers = 20L,
tasks_max = 100
)
controller$start()
names <- character(0L)
index <- 0L
n_tasks <- 60000L
system.time(
while (index < n_tasks || !(controller$empty())) {
if (index < n_tasks) {
index <- index + 1L
cat("submit", index, "\n")
controller$push(
name = as.character(index),
command = TRUE
)
}
out <- controller$pop()
if (!is.null(out)) {
cat("collect", out$name, "\n")
names[[length(names) + 1L]] <- out$name
}
}
) It hangs after a bunch of "collect ..." messages at the end. After interrupting the loop, |
Beta Was this translation helpful? Give feedback.
I believe this is fixed in shikokuchuo/mirai@d7b4f59. The package had certain safeguards that prevented this type of error (but perhaps not always), but I have re-implemented this part so now everything works without those safeguards, and I presume this error should also go away.
It is somewhat non-trivial combining a language with precise memory control such as C and the garbage collection in R, a trade-off between efficiency and safety. But overall I think performance and memory utilisation improves as a result.