-
Notifications
You must be signed in to change notification settings - Fork 129
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
Corrupted storr when killing making process #126
Comments
@dapperjapper I am really glad you brought this up. I think the top priority is to improve storr, maybe adding something like this:
Would you also post this on the storr issue tracker? The solution will ultimately come from there. Still, I will keep this After a failed I am also wondering how to improve job monitoring. For example, what would it take to label and monitor jobs by target name for all kinds of parallelism, not just |
I will post on storr issue tracker! Thanks for quick response! I don't know a lot about processes/*nix systems in general, so I don't think I can be terribly helpful there. One thing I have been wondering about is make()ing in the background without blocking the R session. It seems like knitting Rmds is able to run without blocking, and I'm wondering if drake could ever get a spot like that. Does the knitting process have it's own separate R session that is maintained by RStudio? Can drake get one? Here is a traceback: > clean(premiers_data_raw_sept)
Error in readRDS(self$name_hash(hash)) : error reading from connection
> traceback()
13: readRDS(self$name_hash(hash))
12: self$driver$get_object(hash)
11: self$get_value(self$get_hash(key, namespace), use_cache)
10: cache$get(target)
9: (function (target, cache)
{
if (!(target %in% cache$list()))
return(FALSE)
cache$get(target)$imported
})(target = dots[[1L]][[1L]], cache = <environment>)
8: mapply(FUN = function (target, cache)
{
if (!(target %in% cache$list()))
return(FALSE)
cache$get(target)$imported
}, target = "premiers_data_raw_sept", MoreArgs = list(cache = <environment>),
SIMPLIFY = TRUE, USE.NAMES = TRUE)
7: do.call("mapply", c(FUN = FUN, args[dovec], MoreArgs = list(args[!dovec]),
SIMPLIFY = SIMPLIFY, USE.NAMES = USE.NAMES))
6: is_imported(target = target, cache = cache)
5: (function (target, cache)
{
if (is.null(cache)) {
return()
}
if (is_file(target) & !is_imported(target = target, cache = cache)) {
unquote(target) %>% unlink(recursive = TRUE, force = TRUE)
}
default <- cache$default_namespace
for (space in c(default, "depends", "filemtime", "functions")) if (target %in%
cache$list(namespace = space)) {
cache$del(target, namespace = space)
}
invisible()
})(target = dots[[1L]][[1L]], cache = <environment>)
4: mapply(FUN = function (target, cache)
{
if (is.null(cache)) {
return()
}
if (is_file(target) & !is_imported(target = target, cache = cache)) {
unquote(target) %>% unlink(recursive = TRUE, force = TRUE)
}
default <- cache$default_namespace
for (space in c(default, "depends", "filemtime", "functions")) if (target %in%
cache$list(namespace = space)) {
cache$del(target, namespace = space)
}
invisible()
}, target = "premiers_data_raw_sept", MoreArgs = list(cache = <environment>),
SIMPLIFY = TRUE, USE.NAMES = TRUE)
3: do.call("mapply", c(FUN = FUN, args[dovec], MoreArgs = list(args[!dovec]),
SIMPLIFY = SIMPLIFY, USE.NAMES = USE.NAMES))
2: uncache(targets, cache = cache)
1: clean(premiers_data_raw_sept) |
Semi-related Q: why are you storing object metadata like |
For Fixing that will be ambitious, especially because of back compatibility concerns. A separate preprocessing step will be needed in order to migrate data to the appropriate Here, I see that future can casually run stuff in the background. I will probably try this on my own projects, and maybe include it in the documentation, but probably not work it into |
If we are going to refactor the most sensitive internals, we are most likely not going to have back compatibility. So I want to think long and hard about it, plan and discuss with you guys, and get your support. I probably will not work on it until well after the next CRAN release at least. When I do work on it, I want to share formal design specs and talk about them with the community. I learned a TON over the course of |
To be clear, I have not made the decision to refactor anything that deep. I think there needs to be a stronger reason than just the elegance of the code. Back compatibility is more important than the slight oversensitivity due to tracking |
Definitely -- I agree that it is a big decision. The reason I ask is that the traceback seems to include Is this also the reason why |
We could put some exception handling around In
|
But anyway, the immediate way forward on this is definitely a separate
|
@dapperjapper I think I fixed it in 661e59f. Would you try again? |
By the way, I think |
Is it possible to cache a redundant version of $depends in a separate
namespace, so that assembling the igraph works faster? I can also look at
this tomorrow..
…On Wed, Nov 1, 2017 at 11:13 PM Will Landau ***@***.***> wrote:
By the way, I think clean() runs much faster now.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#126 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPCB18FRv67a-iGs5xCVyTG0CEvWF1Rks5syTNkgaJpZM4QOnHU>
.
|
Actually, building the igraph does not touch the cache at all. See calls to lightly_parallelize() for my attempt to make it faster, along with the thread for #121, particularly here and the follow-up. |
Hmmm. I actually think I won't truly fix this one until I solve #129 or richfitz/storr#55 is fixed I thought I had fixed FYI: 661e59f created a back-compatibility bug in |
I also had the OP's error and it magically went away - likely after I inadvertently upgraded for a different new feature. |
Very helpful to know. I think I will implement something like @fmichonneau's suggestion for storr over all the namespaces and then close. |
Fixed along with the solution to #129. See |
I'm aware that this may be beyond the scope of drake, but occasionally I get this weird non-reproduce-able bug. In the process of working with my data, sometimes I mistakenly start making a target that I know will fail or be incorrect. This freezes up my R session while I wait for it to resolve. Instead of waiting, I kill the RStudio process, or the Makefile process from
htop
.This usually works fine -- in fact, using Makefile parallelism is great because you can see which targets are associated with which processes directly from
htop
and when you kill a process you don't have to relaunch your RStudio session and lose everything in your global environment.However, once in a blue moon, killing a process seems to have consequences. You get these targets that seem to be stuck in a half-saved state, and that cause drake functions to fail with the error:
There seems to be no way to recover from this, other than deleting the whole
.drake
directory and starting from scratch. Even if you know which target was corrupted,clean(target)
fails with the same error. I'm having some success withget_cache()$del(target)
, which makes some things work again but still seems to leave the cache in a semi-corrupted state.I guess I'm just posting to see if anyone else has had similar experiences / how they fixed them without clearing the whole cache.
The text was updated successfully, but these errors were encountered: