Fix a bug that the server process may call kill(-1, SIGUSR1) (#229)

Closes GH-228

`kill(-1, ...)` sends the signal to all processes that the calling
process has permission to send signals to. So tests were sometimes
killed by `SIGUSR1`.

The server process copies `session->executorPID` to
`localSession->peerPID` when `session->initialized` is `true`. But
`session->executorPID` was set only by the main process after
`WaitForBackgroundWorkerStartup()`. If the executor process set
`session->initialized = true` before it, the server process copied
`InvalidPid` (`-1`) and used it for `kill()`.

The executor process sets `session->executorPID` by itself before it
sets `session->initialized = true` with this change.

This also adds `Processor::signal_process()` that does nothing for
`InvalidPid` and uses it for `kill()` calls that didn't check
`InvalidPid`.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
1 file changed
tree: 0aceb1eb0a409d2a00eed0026c702d5ef44f495d
  1. .github/
  2. benchmark/
  3. ci/
  4. dev/
  5. doc/
  6. example/
  7. package/
  8. src/
  9. test/
  10. .asf.yaml
  11. .clang-format
  12. .dockerignore
  13. .editorconfig
  14. .gitignore
  15. .pre-commit-config.yaml
  16. Brewfile
  17. CONTRIBUTING.md
  18. Gemfile
  19. helper.rb
  20. LICENSE.txt
  21. meson.build
  22. meson_options.txt
  23. NOTICE.txt
  24. Rakefile
  25. README.md
README.md

Apache Arrow Flight SQL adapter for PostgreSQL

This is a PostgreSQL extension that adds an Apache Arrow Flight SQL endpoint to PostgreSQL.

See https://arrow.apache.org/flight-sql-postgresql/ for details.

How to contribute

See CONTRIBUTING.md.

License

The Apache License 2.0. See LICENSE.txt for details.