paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1260846156

   Ok, the R error was a bug in our error "helper" that was obscuring an actual 
real related error.
   
   This PR doesn't affect cancellation in the original process, but it does 
result in errors in a forked process (probably something I have to fix on that 
PR?):
   
   ``` r
   library(arrow, warn.conflicts = FALSE)
   #> Some features are not enabled in this build of Arrow. Run `arrow_info()` 
for more information.
   
   tf <- tempfile()
   readr::write_csv(vctrs::vec_rep(mtcars, 5e5), tf)
   
   # try to slow down CSV reading
   set_cpu_count(1)
   set_io_thread_count(2)
   
   # see if arrow actually works in a forked R process (it doesn't)
   parallel::mclapply(1:2, function(...) read_csv_arrow(tf))
   #> Warning in parallel::mclapply(1:2, function(...) read_csv_arrow(tf)): all
   #> scheduled cores encountered errors in user code
   #> [[1]]
   #> [1] "Error in (function (file, delim = \",\", quote = \"\\\"\", 
escape_double = TRUE,  : \n  Invalid: Signal stop source was not set up\nCaused 
by error:\n! Invalid: Signal stop source was not set up\n"
   #> attr(,"class")
   #> [1] "try-error"
   #> attr(,"condition")
   #> <error/rlang_error>
   #> Error:
   #> ! Invalid: Signal stop source was not set up
   #> Caused by error:
   #> ! Invalid: Signal stop source was not set up
   #> ---
   #> Backtrace:
   #>   1. parallel::mclapply(1:2, function(...) read_csv_arrow(tf))
   #>   2. base::lapply(seq_len(cores), inner.do)
   #>   3. parallel (local) FUN(X[[i]], ...)
   #>  10. base::lapply(X = S, FUN = FUN, ...)
   #>  11. global FUN(X[[i]], ...)
   #>  16. arrow (local) `<fn>`(file = tf, delim = ",")
   #> 
   #> [[2]]
   #> [1] "Error in (function (file, delim = \",\", quote = \"\\\"\", 
escape_double = TRUE,  : \n  Invalid: Signal stop source was not set up\nCaused 
by error:\n! Invalid: Signal stop source was not set up\n"
   #> attr(,"class")
   #> [1] "try-error"
   #> attr(,"condition")
   #> <error/rlang_error>
   #> Error:
   #> ! Invalid: Signal stop source was not set up
   #> Caused by error:
   #> ! Invalid: Signal stop source was not set up
   #> ---
   #> Backtrace:
   #>   1. parallel::mclapply(1:2, function(...) read_csv_arrow(tf))
   #>   2. base::lapply(seq_len(cores), inner.do)
   #>   3. parallel (local) FUN(X[[i]], ...)
   #>  10. base::lapply(X = S, FUN = FUN, ...)
   #>  11. global FUN(X[[i]], ...)
   #>  16. arrow (local) `<fn>`(file = tf, delim = ",")
   ```
   
   <sup>Created on 2022-09-28 by the [reprex 
package](https://reprex.tidyverse.org) (v2.0.1)</sup>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to