Skip to content

Document that GucSetting::get panics off the active thread - #2394

Open
rawsun007 wants to merge 1 commit into
pgcentralfoundation:developfrom
rawsun007:doc-guc-get-thread
Open

rawsun007 wants to merge 1 commit into
pgcentralfoundation:developfrom
rawsun007:doc-guc-get-thread

Conversation

@rawsun007

Copy link
Copy Markdown

GucSetting::get() calls check_active_thread() and so panics when called from any thread other than the active Postgres thread, but it had no doc comment, and GucSetting is Sync. Background workers that re-read a GUC from a spawned thread hit this only at runtime. This adds a # Panics section saying so and suggests reading the value on the active thread and passing it along. Closes #2366.

GucSetting is Sync and get() had no doc comment, so nothing warned that
reading a GUC from a thread a background worker spawned panics in
check_active_thread. Closes pgcentralfoundation#2366.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GucSetting::get() panics off the active thread, and nothing on the method says so

1 participant