You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/09/27 16:13:20 UTC

[GitHub] [arrow] pitrou opened a new pull request, #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

pitrou opened a new pull request, #14250:
URL: https://github.com/apache/arrow/pull/14250

   TODO:
   * [ ] Add fork safety tests for SelfPipe
   * [ ] Add fork safety tests for the signal StopSource


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1305992448

   I'll update this to use the at-fork facility introduced in https://github.com/apache/arrow/pull/14594


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1325334100

   I've rebased this now that https://github.com/apache/arrow/pull/14704 is merged. @paleolimbot Can you check the cancellation behavior in R again?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1297492479

   It also should be said that `mclapply()` is not commonly used with Arrow, I just happened to know that it forked the process and it seems like there should be a path to it working (even if that path is disabling cancellation in R).


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1325453723

   I checked the R behaviour again and using this build of Arrow I can (1) cancel CSV reading and ExecPlans and (2) use Arrow from a forked process (i.e., `mclapply()`). All good! Thank you!


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1274331410

   Revision: 7913919a9a2c8cd70e4b4389b0011899d949d152
   
   Submitted crossbow builds: [ursacomputing/crossbow @ signal-self-pipe-fork-1](https://github.com/ursacomputing/crossbow/branches/all?query=signal-self-pipe-fork-1)
   
   |Task|Status|
   |----|------|
   |test-alpine-linux-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-alpine-linux-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-alpine-linux-cpp)|
   |test-build-cpp-fuzz|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-build-cpp-fuzz)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-build-cpp-fuzz)|
   |test-conda-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-conda-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-conda-cpp)|
   |test-conda-cpp-valgrind|[![Azure](https://dev.azure.com/ursacomputing/crossbow/_apis/build/status/ursacomputing.crossbow?branchName=signal-self-pipe-fork-1-azure-test-conda-cpp-valgrind)](https://dev.azure.com/ursacomputing/crossbow/_build/latest?definitionId=1&branchName=signal-self-pipe-fork-1-azure-test-conda-cpp-valgrind)|
   |test-debian-10-cpp-amd64|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-debian-10-cpp-amd64)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-debian-10-cpp-amd64)|
   |test-debian-10-cpp-i386|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-debian-10-cpp-i386)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-debian-10-cpp-i386)|
   |test-debian-11-cpp-amd64|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-debian-11-cpp-amd64)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-debian-11-cpp-amd64)|
   |test-debian-11-cpp-i386|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-debian-11-cpp-i386)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-debian-11-cpp-i386)|
   |test-fedora-35-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-fedora-35-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-fedora-35-cpp)|
   |test-ubuntu-18.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-ubuntu-18.04-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-ubuntu-18.04-cpp)|
   |test-ubuntu-18.04-cpp-release|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-ubuntu-18.04-cpp-release)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-ubuntu-18.04-cpp-release)|
   |test-ubuntu-18.04-cpp-static|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-ubuntu-18.04-cpp-static)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-ubuntu-18.04-cpp-static)|
   |test-ubuntu-20.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-ubuntu-20.04-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-ubuntu-20.04-cpp)|
   |test-ubuntu-20.04-cpp-17|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-ubuntu-20.04-cpp-17)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-ubuntu-20.04-cpp-17)|
   |test-ubuntu-20.04-cpp-bundled|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-ubuntu-20.04-cpp-bundled)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-ubuntu-20.04-cpp-bundled)|
   |test-ubuntu-20.04-cpp-thread-sanitizer|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-ubuntu-20.04-cpp-thread-sanitizer)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-ubuntu-20.04-cpp-thread-sanitizer)|
   |test-ubuntu-22.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-1-github-test-ubuntu-22.04-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-1-github-test-ubuntu-22.04-cpp)|


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1323850140

   Sorry again - I'll try again shortly. I just looked up the new PIDs that popped up and attached lldb one of them...it doesn't take a special R package build (just `ARROW_HOME=/path/to/arrow/install R CMD INSTALL path/to/arrow/r`).


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1324134315

   Ok, I think I've found the issue. It is a problem with initialization order of static/global variables in Arrow C++.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1297133671

   
   Le 31/10/2022 à 14:48, Dewey Dunnington a écrit :
   > Ok, I checked this again, and the errors that I get are:
   > 
   > |/Users/dewey/Desktop/rscratch/arrow/cpp/src/arrow/status.cc:134: 
   > Invalid: Signal stop source was not set up 
   > /Users/dewey/Desktop/rscratch/arrow/cpp/src/arrow/status.cc:134: 
   > Invalid: Signal stop source was not set up |
   > 
   > In the code in the R package, I'm careful not error (but instead warn) 
   > on the result of |RegisterCancellingSignalHandler()|, and so I wonder if 
   > this is coming from C++ instead?
   
   I don't know, can you try to turn this error into an abort and get a 
   debugger backtrace?
   
   Also, can you describe the flow of C++ API calls to manage the signal 
   stop source that R is doing?
   
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] github-actions[bot] commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1273495018

   https://issues.apache.org/jira/browse/ARROW-17859


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1315316288

   @github-actions crossbow submit -g cpp


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1259988166

   "object 'tab' not found" is purely an R error? It looks weird.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] github-actions[bot] commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1315320622

   Revision: 653a584e16129bf9573a6695adc7dcb14783adbd
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-ca67d883f6](https://github.com/ursacomputing/crossbow/branches/all?query=actions-ca67d883f6)
   
   |Task|Status|
   |----|------|
   |test-alpine-linux-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-alpine-linux-cpp)](https://github.com/ursacomputing/crossbow/actions/runs/3470895632/jobs/5799674784)|
   |test-build-cpp-fuzz|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-build-cpp-fuzz)](https://github.com/ursacomputing/crossbow/actions/runs/3470894995/jobs/5799673323)|
   |test-conda-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-conda-cpp)](https://github.com/ursacomputing/crossbow/actions/runs/3470899748/jobs/5799684609)|
   |test-conda-cpp-valgrind|[![Azure](https://dev.azure.com/ursacomputing/crossbow/_apis/build/status/ursacomputing.crossbow?branchName=actions-ca67d883f6-azure-test-conda-cpp-valgrind)](https://github.com/ursacomputing/crossbow/runs/9500470098)|
   |test-cuda-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-cuda-cpp)](https://github.com/ursacomputing/crossbow/actions/runs/3470899101/jobs/5799683206)|
   |test-debian-10-cpp-amd64|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-debian-10-cpp-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/3470902002/jobs/5799689908)|
   |test-debian-10-cpp-i386|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-debian-10-cpp-i386)](https://github.com/ursacomputing/crossbow/actions/runs/3470900525/jobs/5799686462)|
   |test-debian-11-cpp-amd64|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-debian-11-cpp-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/3470897306/jobs/5799679065)|
   |test-debian-11-cpp-i386|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-debian-11-cpp-i386)](https://github.com/ursacomputing/crossbow/actions/runs/3470898656/jobs/5799682234)|
   |test-fedora-35-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-fedora-35-cpp)](https://github.com/ursacomputing/crossbow/actions/runs/3470903539/jobs/5799693273)|
   |test-ubuntu-18.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-ubuntu-18.04-cpp)](https://github.com/ursacomputing/crossbow/actions/runs/3470897739/jobs/5799680099)|
   |test-ubuntu-18.04-cpp-release|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-ubuntu-18.04-cpp-release)](https://github.com/ursacomputing/crossbow/actions/runs/3470902986/jobs/5799692117)|
   |test-ubuntu-18.04-cpp-static|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-ubuntu-18.04-cpp-static)](https://github.com/ursacomputing/crossbow/actions/runs/3470896776/jobs/5799677823)|
   |test-ubuntu-20.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-ubuntu-20.04-cpp)](https://github.com/ursacomputing/crossbow/actions/runs/3470900281/jobs/5799685778)|
   |test-ubuntu-20.04-cpp-20|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-ubuntu-20.04-cpp-20)](https://github.com/ursacomputing/crossbow/actions/runs/3470896357/jobs/5799676833)|
   |test-ubuntu-20.04-cpp-bundled|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-ubuntu-20.04-cpp-bundled)](https://github.com/ursacomputing/crossbow/actions/runs/3470901625/jobs/5799688971)|
   |test-ubuntu-20.04-cpp-thread-sanitizer|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-ubuntu-20.04-cpp-thread-sanitizer)](https://github.com/ursacomputing/crossbow/actions/runs/3470896139/jobs/5799676284)|
   |test-ubuntu-22.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=actions-ca67d883f6-github-test-ubuntu-22.04-cpp)](https://github.com/ursacomputing/crossbow/actions/runs/3470901040/jobs/5799687723)|


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1323881496

   That's in the child process, right?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1325334923

   @github-actions crossbow submit -g cpp -g python -g wheel


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1297483100

   > I don't know, can you try to turn this error into an abort and get a debugger backtrace?
   
   I can look into how to do this tomorrow; off the top of my head I don't have something set up to do this. Usually I get a full backtrace with my errors because I have the extra error context turned on, and I don't know why it's not appearing here.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou merged pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou merged PR #14250:
URL: https://github.com/apache/arrow/pull/14250


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1324043229

   Last finding: things work fine with `parallel::mclapply(1:1, function(...) { read_csv_arrow(tf) })`, but not with `parallel::mclapply(1:2, function(...) { read_csv_arrow(tf) })`.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1323862327

   I'll try to improve my lldb command repetoire, but there are two threads. The first thread is held up as the screenshot above; the second thread is hung up here:
   
   <img width="692" alt="Screen Shot 2022-11-22 at 11 31 40 AM" src="https://user-images.githubusercontent.com/10995762/203355279-3f183d78-c8c1-4889-ad8c-87e25b81c6ba.png">
   
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1314087821

   I think I understand what happens in the Python CI failures and will try to fix them tomorrow.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1315531277

   I'll verify with some print statements when I'm back working on that branch, but I believe it's:
   
   - register stop source (package load)
   - register signal handler (before read_csv_arrow())
   - unregister signal handler (after read_csv_arrow())
   - For each worker:
       - register signal handler (before read_csv_arrow())
       - unregister signal handler (after read_csv_arrow())


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1317605946

   Hmm... can you get a complete backtrace of all threads? In gdb this would be `thread apply all bt`.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1324006688

   @paleolimbot I see that the R Arrow bindings are compiled with `-O2`, is there a way to disable that to get better debugging?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1324022124

   By the way, I actually reproduce the issue on git master, so the issue is not specifically with this PR, right?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1323882363

   Yes, those are in the child process.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1315533815

   > I'll verify with some print statements when I'm back working on that branch, but I believe it's:
   
   Weird, because that call sequence is exercised in the C++ tests here:
   https://github.com/apache/arrow/pull/14250/files#diff-9dba983f4132467a6a3a181bc8fddd1bbdf2c5101c667f89c71c3bcd9f2f2430R263-R272
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1315523328

   > if a signal handler ever gets registered before forking
   
   What is the exact call sequence in that case?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1315636210

   Is it the child processes that hang? Can you run hook gdb into them to get a full backtrace of all threads there?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] ursabot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1327969199

   Benchmark runs are scheduled for baseline = ada7e23959dabcd4f586ad8c269dc2a6267ccacd and contender = 94e45faf6afe7280464503da0d5f8be31afb5097. 94e45faf6afe7280464503da0d5f8be31afb5097 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/a53586a5f194411aa1724ac9ac0e78b3...7d54dce57b1c49c7a370b5d20cac00cb/)
   [Finished :arrow_down:0.4% :arrow_up:0.0%] [test-mac-arm](https://conbench.ursa.dev/compare/runs/6875a6fc68b14beeba574a0987563a52...0601e6054e284e58b83e007f20d42287/)
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/be83531a336746c9b31dcea0240bb2db...8a8019db2149481994fa8ad890ec203d/)
   [Finished :arrow_down:0.31% :arrow_up:0.03%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/dd8a78b1b0a149418b002e009a6948f2...6058194857b7464aa3fb812af3535964/)
   Buildkite builds:
   [Finished] [`94e45faf` ec2-t3-xlarge-us-east-2](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/1926)
   [Finished] [`94e45faf` test-mac-arm](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/1948)
   [Finished] [`94e45faf` ursa-i9-9960x](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/1918)
   [Finished] [`94e45faf` ursa-thinkcentre-m75q](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/1940)
   [Finished] [`ada7e239` ec2-t3-xlarge-us-east-2](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/1925)
   [Finished] [`ada7e239` test-mac-arm](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/1947)
   [Finished] [`ada7e239` ursa-i9-9960x](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/1917)
   [Finished] [`ada7e239` ursa-thinkcentre-m75q](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/1939)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1317528182

   Ok, I figured it out...this is what I get when I attach a debugger:
   
   <img width="710" alt="Screen Shot 2022-11-16 at 3 02 13 PM" src="https://user-images.githubusercontent.com/10995762/202270085-c84f4013-efce-45cf-bb93-5c4872a5bad4.png">
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] github-actions[bot] commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1273495075

   :warning: Ticket **has not been started in JIRA**, please click 'Start Progress'.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1275475932

   I'll investigate more when I'm back from PTO on Monday, but I did a quick check and (1) cancellation still works interactively and (2) this does seem to break forked process behaviour when using R + arrow:
   
   <details>
   
   ``` 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)
   
   # make sure we can cancel
   read_csv_arrow(tf)
   #> # A tibble: 16,000,000 × 11
   #>      mpg   cyl  disp    hp  drat    wt  qsec    vs    am  gear  carb
   #>    <dbl> <int> <dbl> <int> <dbl> <dbl> <dbl> <int> <int> <int> <int>
   #>  1  21       6  160    110  3.9   2.62  16.5     0     1     4     4
   #>  2  21       6  160    110  3.9   2.88  17.0     0     1     4     4
   #>  3  22.8     4  108     93  3.85  2.32  18.6     1     1     4     1
   #>  4  21.4     6  258    110  3.08  3.22  19.4     1     0     3     1
   #>  5  18.7     8  360    175  3.15  3.44  17.0     0     0     3     2
   #>  6  18.1     6  225    105  2.76  3.46  20.2     1     0     3     1
   #>  7  14.3     8  360    245  3.21  3.57  15.8     0     0     3     4
   #>  8  24.4     4  147.    62  3.69  3.19  20       1     0     4     2
   #>  9  22.8     4  141.    95  3.92  3.15  22.9     1     0     4     2
   #> 10  19.2     6  168.   123  3.92  3.44  18.3     1     0     4     4
   #> # … with 15,999,990 more rows
   
   # see if arrow works in a forked R process
   parallel::mclapply(1:2, function(...) read_csv_arrow(tf))
   #> Warning in parallel::mclapply(1:2, function(...) read_csv_arrow(tf)): scheduled
   #> cores 1, 2 did not deliver results, all values of the jobs will be affected
   #> [[1]]
   #> NULL
   #> 
   #> [[2]]
   #> NULL
   ```
   
   <sup>Created on 2022-10-11 by the [reprex package](https://reprex.tidyverse.org) (v2.0.1)</sup>
   
   </details>


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1273537078

   Revision: 9e2bf2d5ac93e13d432ff6dbaea182c36e930d6f
   
   Submitted crossbow builds: [ursacomputing/crossbow @ signal-self-pipe-fork-0](https://github.com/ursacomputing/crossbow/branches/all?query=signal-self-pipe-fork-0)
   
   |Task|Status|
   |----|------|
   |test-alpine-linux-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-alpine-linux-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-alpine-linux-cpp)|
   |test-build-cpp-fuzz|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-build-cpp-fuzz)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-build-cpp-fuzz)|
   |test-conda-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-conda-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-conda-cpp)|
   |test-conda-cpp-valgrind|[![Azure](https://dev.azure.com/ursacomputing/crossbow/_apis/build/status/ursacomputing.crossbow?branchName=signal-self-pipe-fork-0-azure-test-conda-cpp-valgrind)](https://dev.azure.com/ursacomputing/crossbow/_build/latest?definitionId=1&branchName=signal-self-pipe-fork-0-azure-test-conda-cpp-valgrind)|
   |test-debian-10-cpp-amd64|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-debian-10-cpp-amd64)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-debian-10-cpp-amd64)|
   |test-debian-10-cpp-i386|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-debian-10-cpp-i386)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-debian-10-cpp-i386)|
   |test-debian-11-cpp-amd64|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-debian-11-cpp-amd64)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-debian-11-cpp-amd64)|
   |test-debian-11-cpp-i386|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-debian-11-cpp-i386)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-debian-11-cpp-i386)|
   |test-fedora-35-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-fedora-35-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-fedora-35-cpp)|
   |test-ubuntu-18.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-ubuntu-18.04-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-ubuntu-18.04-cpp)|
   |test-ubuntu-18.04-cpp-release|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-ubuntu-18.04-cpp-release)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-ubuntu-18.04-cpp-release)|
   |test-ubuntu-18.04-cpp-static|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-ubuntu-18.04-cpp-static)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-ubuntu-18.04-cpp-static)|
   |test-ubuntu-20.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-ubuntu-20.04-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-ubuntu-20.04-cpp)|
   |test-ubuntu-20.04-cpp-17|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-ubuntu-20.04-cpp-17)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-ubuntu-20.04-cpp-17)|
   |test-ubuntu-20.04-cpp-bundled|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-ubuntu-20.04-cpp-bundled)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-ubuntu-20.04-cpp-bundled)|
   |test-ubuntu-20.04-cpp-thread-sanitizer|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-ubuntu-20.04-cpp-thread-sanitizer)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-ubuntu-20.04-cpp-thread-sanitizer)|
   |test-ubuntu-22.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-fork-0-github-test-ubuntu-22.04-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-fork-0-github-test-ubuntu-22.04-cpp)|


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1261000147

   I updated #13635 so that it just warns here instead of erroring. The gist of that is that the `StopSource()` that I have saved is not null; however, calling `RegisterCancellingSignalHandler()` errors saying that it is not set up.
   
   If the stop token didn't live with the filesystem it probably wouldn't be an issue because the process in general would never be forked before a cancellable operation was invoked (although I'm sure somebody will try to use `mclapply()` in a user-defined function at some point, so it should still probably not error).


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1260925168

   Thanks for checking @paleolimbot . That's setting that might be fixed on the C++ side. I'll think about it.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1315330293

   @paleolimbot Could you give this PR a try again?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1323831931

   @paleolimbot If you're not able to do this, is there an easy way for me to reproduce using a Linux Docker container?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1259813002

   @paleolimbot Could you try the R cancellation with this PR?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1259980130

   Cancellation works exactly the same on this branch as it does on the master branch!
   
   It's probably not related to this PR, but it looks like attempting to call arrow from a forked process in R doesn't work. I think this is the same on the master branch (will check tomorrow).
   
   <details>
   
   ``` 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:4, function(...) read_csv_arrow(tf))
   #> Warning in parallel::mclapply(1:4, function(...) read_csv_arrow(tf)): all
   #> scheduled cores encountered errors in user code
   #> [[1]]
   #> [1] "Error in as.data.frame(tab) : object 'tab' not found\n"
   #> attr(,"class")
   #> [1] "try-error"
   #> attr(,"condition")
   #> <simpleError in as.data.frame(tab): object 'tab' not found>
   #> 
   #> [[2]]
   #> [1] "Error in as.data.frame(tab) : object 'tab' not found\n"
   #> attr(,"class")
   #> [1] "try-error"
   #> attr(,"condition")
   #> <simpleError in as.data.frame(tab): object 'tab' not found>
   #> 
   #> [[3]]
   #> [1] "Error in as.data.frame(tab) : object 'tab' not found\n"
   #> attr(,"class")
   #> [1] "try-error"
   #> attr(,"condition")
   #> <simpleError in as.data.frame(tab): object 'tab' not found>
   #> 
   #> [[4]]
   #> [1] "Error in as.data.frame(tab) : object 'tab' not found\n"
   #> attr(,"class")
   #> [1] "try-error"
   #> attr(,"condition")
   #> <simpleError in as.data.frame(tab): object 'tab' not found>
   ```
   
   <sup>Created on 2022-09-27 by the [reprex package](https://reprex.tidyverse.org) (v2.0.1)</sup>
   
   </details>


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1315604524

   Ok, here's the print output:
   
   ```
   > library(arrow, warn.conflicts = FALSE)
   arrow::SetSignalStopSource()
   Some features are not enabled in this build of Arrow. Run `arrow_info()` for more information.
   > tf <- tempfile()
   > write.csv(mtcars, tf, row.names = FALSE)
   > # before calling anything with the cancellation api, everything works
   > x <- parallel::mclapply(1:2, function(...) {
   +   read_csv_arrow(tf)
   + })
   arrow::RegisterCancellingSignalHandler({SIGINT});
   arrow::RegisterCancellingSignalHandler({SIGINT});
   arrow::UnregisterCancellingSignalHandler();
   stop_source_->Reset();
   arrow::UnregisterCancellingSignalHandler();
   stop_source_->Reset();
   > # invoke cancellation in the main process
   > x <- read_csv_arrow(tf)
   arrow::RegisterCancellingSignalHandler({SIGINT});
   arrow::UnregisterCancellingSignalHandler();
   stop_source_->Reset();
   > # this hangs
   > x <- parallel::mclapply(1:2, function(...) {
   +   read_csv_arrow(tf)
   + })
   arrow::RegisterCancellingSignalHandler({SIGINT});
   arrow::RegisterCancellingSignalHandler({SIGINT});
   ```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1315641461

   I'll try to set that up...I've never done that before so it may take me a bit. It's almost certainly the child processes that hang...I can usually (every time except once) interrupt main process via Control-C and get my prompt back.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1323898764

   > can you tell me how to run the reproducer code exactly? :-)
   
   What I did was:
   
   1. Checkout your branch
   2. Build + install the C++ library. The R package needs a folder with something/include and something/lib where the ARROW_HOME environment variable is set to "something".
   3. You'll need R (`apt-get install r-base` is an old version but works) + the package deps. The easiest way to get them is to install the version of arrow from CRAN before installing the one for your branch (`R -e 'install.packages("arrow", repos = "https://cloud.r-project.org")'`. This Dockerfile might be helpful: https://gist.github.com/paleolimbot/be77218201bdbd20353c084c74254824
   4. `cd path/to/arrow/r && R CMD INSTALL .`
   5. Open an interactive terminal, type in `R`, copy/paste this:
   
   <details>
   
   ```r
   library(arrow, warn.conflicts = FALSE)
   
   tf <- tempfile()
   write.csv(mtcars, tf, row.names = FALSE)
   
   read_csv_arrow(tf)
   
   parallel::mclapply(1:2, function(...) {
     read_csv_arrow(tf)
   })
   ```
   
   </details>
   
   Here's maybe some more raw output from lldb:
   
   <details>
   
   Console is in 'commands' mode, prefix expressions with '?'.
   Attached to process 81057
   Stop reason: signal SIGSTOP
   t 1
   
   bt
     thread #2
       frame #0: 0x00000001b114b634 libsystem_kernel.dylib`read + 8
       frame #1: 0x00000002807c9be4 libarrow.1100.0.0.dylib`arrow::internal::(anonymous namespace)::SelfPipeImpl::Wait(this=0x00006000013e15a8) at io_util.cc:1268:24
       frame #2: 0x00000002807682f4 libarrow.1100.0.0.dylib`arrow::(anonymous namespace)::SignalStopState::ReceiveSignals(self_pipe=std::__1::shared_ptr<arrow::internal::SelfPipe>::element_type @ 0x00006000013e15a8 strong=3 weak=3) at cancel.cc:246:39
       frame #3: 0x0000000280769294 libarrow.1100.0.0.dylib`decltype(__f=0x0000000152e82008, __args=nullptr)(static_cast<std::__1::shared_ptr<arrow::internal::SelfPipe>>(fp0))) std::__1::__invoke<void (*)(std::__1::shared_ptr<arrow::internal::SelfPipe>), std::__1::shared_ptr<arrow::internal::SelfPipe>>(void (*&&)(std::__1::shared_ptr<arrow::internal::SelfPipe>), std::__1::shared_ptr<arrow::internal::SelfPipe>&&) at type_traits:3918:1
       frame #4: 0x000000028076920c libarrow.1100.0.0.dylib`void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::shared_ptr<arrow::internal::SelfPipe>), std::__1::shared_ptr<arrow::internal::SelfPipe>, 2ul>(__t=size=3, (null)=__tuple_indices<2> @ 0x000000016c132f7f)(std::__1::shared_ptr<arrow::internal::SelfPipe>), std::__1::shared_ptr<arrow::internal::SelfPipe>>&, std::__1::__tuple_indices<2ul>) at thread:287:5
       frame #5: 0x00000002807688ac libarrow.1100.0.0.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::shared_ptr<arrow::internal::SelfPipe>), std::__1::shared_ptr<arrow::internal::SelfPipe>>>(__vp=0x0000000152e82000) at thread:298:5
       frame #6: 0x00000001b118826c libsystem_pthread.dylib`_pthread_start + 148
   
   t 2
   
   bt
   * thread #2
     * frame #0: 0x00000001b114b634 libsystem_kernel.dylib`read + 8
       frame #1: 0x00000002807c9be4 libarrow.1100.0.0.dylib`arrow::internal::(anonymous namespace)::SelfPipeImpl::Wait(this=0x00006000013e15a8) at io_util.cc:1268:24
       frame #2: 0x00000002807682f4 libarrow.1100.0.0.dylib`arrow::(anonymous namespace)::SignalStopState::ReceiveSignals(self_pipe=std::__1::shared_ptr<arrow::internal::SelfPipe>::element_type @ 0x00006000013e15a8 strong=3 weak=3) at cancel.cc:246:39
       frame #3: 0x0000000280769294 libarrow.1100.0.0.dylib`decltype(__f=0x0000000152e82008, __args=nullptr)(static_cast<std::__1::shared_ptr<arrow::internal::SelfPipe>>(fp0))) std::__1::__invoke<void (*)(std::__1::shared_ptr<arrow::internal::SelfPipe>), std::__1::shared_ptr<arrow::internal::SelfPipe>>(void (*&&)(std::__1::shared_ptr<arrow::internal::SelfPipe>), std::__1::shared_ptr<arrow::internal::SelfPipe>&&) at type_traits:3918:1
       frame #4: 0x000000028076920c libarrow.1100.0.0.dylib`void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::shared_ptr<arrow::internal::SelfPipe>), std::__1::shared_ptr<arrow::internal::SelfPipe>, 2ul>(__t=size=3, (null)=__tuple_indices<2> @ 0x000000016c132f7f)(std::__1::shared_ptr<arrow::internal::SelfPipe>), std::__1::shared_ptr<arrow::internal::SelfPipe>>&, std::__1::__tuple_indices<2ul>) at thread:287:5
   
     frame #5: 0x00000002807688ac libarrow.1100.0.0.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::shared_ptr<arrow::internal::SelfPipe>), std::__1::shared_ptr<arrow::internal::SelfPipe>>>(__vp=0x0000000152e82000) at thread:298:5
       frame #6: 0x00000001b118826c libsystem_pthread.dylib`_pthread_start + 148
   
   </details>


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1324082795

   > By the way, I actually reproduce the issue on git master, so the issue is not specifically with this PR, right?
   
   When we started this conversation I had tried both and the hanging was specific to this PR, but very possible that some other code change affected that (I tested with Arrow 10.0.0 via `install.packages("arrow")` which included some cancellation features and this does work there). You're welcome to defer that to another PR but it's not something that I have any idea how to fix.
   
   I am going to revisit the section of code that's hanging on the R side (specifically, I'm going to try avoiding the IO thread pool to launch the "do arrow stuff" thread) soon whilst trying to fix #14582 in a more permanent way and perhaps that may be a good time to revisit.
   
   > I see that the R Arrow bindings are compiled with -O2, is there a way to disable that to get better debugging?
   
   Yes...I will add it to the Dockerfile later today. It's along the lines of `mkdir ~/.R && echo "CXX17FLAGS := -g -O0" > .R/Makevars` but it always takes me a few tries.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1323883200

   > I just looked up the new PIDs that popped up and attached lldb one of them...it doesn't take a special R package build
   
   Hmm, ok. Since I'm a R newbie, can you tell me how to run the reproducer code exactly? :-)


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1297600811

   > The sequence is (for better or worse):
   
   Can you describe where the fork() call happens in that sequence?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1297483616

   Oh, and the error *is* and abort, it just happens in a worker process so R reports it as a warning.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1259733059

   Revision: f7e6abddd8dfa42be59d0b8b3dd5e2eee9148334
   
   Submitted crossbow builds: [ursacomputing/crossbow @ signal-self-pipe-0](https://github.com/ursacomputing/crossbow/branches/all?query=signal-self-pipe-0)
   
   |Task|Status|
   |----|------|
   |test-alpine-linux-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-alpine-linux-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-alpine-linux-cpp)|
   |test-build-cpp-fuzz|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-build-cpp-fuzz)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-build-cpp-fuzz)|
   |test-conda-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-conda-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-conda-cpp)|
   |test-conda-cpp-valgrind|[![Azure](https://dev.azure.com/ursacomputing/crossbow/_apis/build/status/ursacomputing.crossbow?branchName=signal-self-pipe-0-azure-test-conda-cpp-valgrind)](https://dev.azure.com/ursacomputing/crossbow/_build/latest?definitionId=1&branchName=signal-self-pipe-0-azure-test-conda-cpp-valgrind)|
   |test-debian-10-cpp-amd64|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-debian-10-cpp-amd64)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-debian-10-cpp-amd64)|
   |test-debian-10-cpp-i386|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-debian-10-cpp-i386)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-debian-10-cpp-i386)|
   |test-debian-11-cpp-amd64|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-debian-11-cpp-amd64)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-debian-11-cpp-amd64)|
   |test-debian-11-cpp-i386|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-debian-11-cpp-i386)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-debian-11-cpp-i386)|
   |test-fedora-35-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-fedora-35-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-fedora-35-cpp)|
   |test-ubuntu-18.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-ubuntu-18.04-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-ubuntu-18.04-cpp)|
   |test-ubuntu-18.04-cpp-release|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-ubuntu-18.04-cpp-release)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-ubuntu-18.04-cpp-release)|
   |test-ubuntu-18.04-cpp-static|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-ubuntu-18.04-cpp-static)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-ubuntu-18.04-cpp-static)|
   |test-ubuntu-20.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-ubuntu-20.04-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-ubuntu-20.04-cpp)|
   |test-ubuntu-20.04-cpp-17|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-ubuntu-20.04-cpp-17)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-ubuntu-20.04-cpp-17)|
   |test-ubuntu-20.04-cpp-bundled|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-ubuntu-20.04-cpp-bundled)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-ubuntu-20.04-cpp-bundled)|
   |test-ubuntu-20.04-cpp-thread-sanitizer|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-ubuntu-20.04-cpp-thread-sanitizer)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-ubuntu-20.04-cpp-thread-sanitizer)|
   |test-ubuntu-22.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=signal-self-pipe-0-github-test-ubuntu-22.04-cpp)](https://github.com/ursacomputing/crossbow/actions?query=branch:signal-self-pipe-0-github-test-ubuntu-22.04-cpp)|


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1273568090

   @paleolimbot Would you like to try out this PR again?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1297480732

   The sequence is (for better or worse):
   
   - Package load: create stop source
   - Every R call into C++ that launches a new thread: register signal handlers
   - For every C++ call into R via SafeCallIntoR, unregister signal handlers for the duration of the call (this might not be necessary)
   - When the R call into C++ returns control to R, unregister signal handlers
   - On package unload (usually when the process is about to end), destroy the stop source


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1298389526

   In the example I've been using the sequence is (I think)
   
   - Package load: create stop source
   - (do some Arrow setup stuff)
   - Use fork() to create workers in `mclapply()`
   - Every R call into C++ that launches a new thread: register signal handlers
   - For every C++ call into R via SafeCallIntoR, unregister signal handlers for the duration of the call (this might not be necessary)
   - When the R call into C++ returns control to R, unregister signal handlers
   - On package unload (usually when the process is about to end), destroy the stop source
   
   In this example...
   
   The sequence is:


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1297119973

   Ok, I checked this again, and the errors that I get are:
   
   ```
   /Users/dewey/Desktop/rscratch/arrow/cpp/src/arrow/status.cc:134: Invalid: Signal stop source was not set up
   /Users/dewey/Desktop/rscratch/arrow/cpp/src/arrow/status.cc:134: Invalid: Signal stop source was not set up
   ```
   
   In the code in the R package, I'm careful not error (but instead warn) on the result of `RegisterCancellingSignalHandler()`, and so I wonder if this is coming from C++ instead?
   
   I would still prefer to not mess with signal handling in the R package since I have a limited ability to debug this myself. I'm aware that I have a poor understanding of the constraints here, but the R package could probably provide a thread-safe callable like `bool (*should_we_stop)(void)` and avoid imposing the constraints of R on this section of Arrow C++.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1323968511

   Okay, I'm certainly going to use one of the Docker configurations.
   The problem is that it doesn't build R Arrow separately, it just runs this all-in-one script: https://github.com/apache/arrow/blob/master/ci/scripts/r_test.sh
   
   Would you like to explain how I can modify that script to just build R Arrow but not run the whole gamut of checks/tests/etc.?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] paleolimbot commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1315422027

   Sure thing! I tried:
   
   ```r
   library(arrow, warn.conflicts = FALSE)
   
   tf <- tempfile()
   write.csv(mtcars, tf, row.names = FALSE)
   
   # If we use the signal handling infrastructure in the main process before
   # doing the forked workers thing, then the calls hang
   # read_csv_arrow(tf)
   
   parallel::mclapply(1:2, function(...) {
     read_csv_arrow(tf)
   })
   ```
   
   Cancellation in the main process still works; however, the worker processes hang instead of error (if a signal handler ever gets registered before forking).


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on pull request #14250: ARROW-17859: [C++] Use self-pipe in signal-receiving StopSource

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #14250:
URL: https://github.com/apache/arrow/pull/14250#issuecomment-1313895110

   Revision: 9ef40c2a81f14b3c5d004ee90f4e7c443fe96ac4
   
   Submitted crossbow builds: [ursacomputing/crossbow @ ARROW-17859-signal-self-pipe-0](https://github.com/ursacomputing/crossbow/branches/all?query=ARROW-17859-signal-self-pipe-0)
   
   |Task|Status|
   |----|------|
   |test-alpine-linux-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-alpine-linux-cpp)](https://github.com/ursacomputing/crossbow/actions/runs/3462611908/jobs/5781734875)|
   |test-build-cpp-fuzz|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-build-cpp-fuzz)](https://github.com/ursacomputing/crossbow/actions/runs/3462620751/jobs/5781756263)|
   |test-conda-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-conda-cpp)](https://github.com/ursacomputing/crossbow/actions/runs/3462619674/jobs/5781750896)|
   |test-conda-cpp-valgrind|[![Azure](https://dev.azure.com/ursacomputing/crossbow/_apis/build/status/ursacomputing.crossbow?branchName=ARROW-17859-signal-self-pipe-0-azure-test-conda-cpp-valgrind)](https://github.com/ursacomputing/crossbow/runs/9476788933)|
   |test-cuda-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-cuda-cpp)](https://github.com/ursacomputing/crossbow/actions/runs/3462611247/jobs/5781733522)|
   |test-debian-10-cpp-amd64|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-debian-10-cpp-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/3462620501/jobs/5781752531)|
   |test-debian-10-cpp-i386|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-debian-10-cpp-i386)](https://github.com/ursacomputing/crossbow/actions/runs/3462612667/jobs/5781736312)|
   |test-debian-11-cpp-amd64|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-debian-11-cpp-amd64)](https://github.com/ursacomputing/crossbow/actions/runs/3462613961/jobs/5781738880)|
   |test-debian-11-cpp-i386|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-debian-11-cpp-i386)](https://github.com/ursacomputing/crossbow/actions/runs/3462619214/jobs/5781749707)|
   |test-fedora-35-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-fedora-35-cpp)](https://github.com/ursacomputing/crossbow/actions/runs/3462617601/jobs/5781746839)|
   |test-ubuntu-18.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-ubuntu-18.04-cpp)](https://github.com/ursacomputing/crossbow/actions/runs/3462615295/jobs/5781741381)|
   |test-ubuntu-18.04-cpp-release|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-ubuntu-18.04-cpp-release)](https://github.com/ursacomputing/crossbow/actions/runs/3462614632/jobs/5781740118)|
   |test-ubuntu-18.04-cpp-static|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-ubuntu-18.04-cpp-static)](https://github.com/ursacomputing/crossbow/actions/runs/3462610400/jobs/5781731153)|
   |test-ubuntu-20.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-ubuntu-20.04-cpp)](https://github.com/ursacomputing/crossbow/actions/runs/3462618256/jobs/5781748151)|
   |test-ubuntu-20.04-cpp-20|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-ubuntu-20.04-cpp-20)](https://github.com/ursacomputing/crossbow/actions/runs/3462616415/jobs/5781743803)|
   |test-ubuntu-20.04-cpp-bundled|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-ubuntu-20.04-cpp-bundled)](https://github.com/ursacomputing/crossbow/actions/runs/3462617136/jobs/5781745757)|
   |test-ubuntu-20.04-cpp-thread-sanitizer|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-ubuntu-20.04-cpp-thread-sanitizer)](https://github.com/ursacomputing/crossbow/actions/runs/3462613395/jobs/5781737774)|
   |test-ubuntu-22.04-cpp|[![Github Actions](https://github.com/ursacomputing/crossbow/workflows/Crossbow/badge.svg?branch=ARROW-17859-signal-self-pipe-0-github-test-ubuntu-22.04-cpp)](https://github.com/ursacomputing/crossbow/actions/runs/3462615898/jobs/5781742470)|


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org