-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: lidR:::cluster_apply() relies on resolved() having a long timeout
setting
#435
Comments
I reproduced, I found where the error was triggered I found the variable that was different in the two run. I should be able to figure out what happens. But it is non trivial and very hard to understand. I'm investigating |
I fixed it. There was a bug in my code that could only be reached with a combination of Thanks for reporting |
Awesome.
Good. Yeah, the fact that different timeout lengths changed the behavior is odd, since Either way, thanks for fixing so quickly. You're packages tests, together with all the other 180 packages, are invaluable when it comes to bug fixing, improving, and introducing new features in the future framework. |
The idea is that I have a for (i in x) {
f[i]= future(expr[i])
for (j in 1:i) {
states[j] = test_state(f[j])
update_state_monitoring(states)
}
} where The problem is that in parallel this loop may be ended but some elements might still be processing in the background (or remotely). Thus there is a second loop like that. while (any(states == PROCESSING))
{
idx <- which(states == PROCESSING)
for (j in i) {
states[j] = test_state(f[j])
update_state_monitoring(states)
}
sleep()
} In my case The error was a combination of the
And the ability to run either local or remote parallel tasks in a single line of code without fully understanding how it works is even more valuable 😉 |
In the next release of future, we're shortening how long
future::resolve()
will wait for results until giving up (and returningFALSE
). Basically, we'll update the default fromresolved(..., timeout = 0.2)
toresolved(..., timeout = 0.01)
. This will improve the performance since we'll spend less time polling futures.When running reverse package dependency checks, everything seemed to work at first, but when I force all package checks to use 'multisession' by default (instead of 'sequential'), I spotted a problem with
lidR:::cluster_apply()
.Here's a minimal reproducible example adopted from testthat/test-catalog-engine-generic.R:
If I run with a timeout of 0.01 seconds, I get:
If I run with a timeout of 0.2 seconds, it works.
Could you please check and see if you can figure out why this happens?
PS. This is the only package out of ~180 that fails this way.
PS2. Although you should be able to trust all future packages to work the same, there are of course corner cases, etc. If you want to be extra certain that things works, I recommend that all package developers check their packages also with
$ export R_FUTURE_PLAN=multisession $ R CMD check --as-cran mypkg_1.0.tar.gz
The text was updated successfully, but these errors were encountered: