forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0ae5b76
committed
Clean up handling of client_encoding GUC in parallel workers.
The previous coding here threw an error from assign_client_encodingif it was invoked in a parallel worker. That's a very fundamentalviolation of the GUC hook API: assign hooks must not throw errors.The place to complain is in the check hook, so move the test tothere, and use the regular check-hook API (ie return false) toreport it.The reason this coding is a problem is that it breaks GUC rollback,which may occur after we leave InitializingParallelWorker state.That case seems not actually reachable before now, but commitf5f30c2 made it reachable, so we need to fix this before thatcan be un-reverted.In passing, improve the commentary in ParallelWorkerMain, andadd a check for failure of SetClientEncoding. That's anothercase that can't happen now but might become possible afterforeseeable code rearrangements (notably, if the shortcut ofskipping PrepareClientEncoding stops being OK).Discussion:https://postgr.es/m/18545-feba138862f19aaa@postgresql.org1 parent8928817 commit0ae5b76
2 files changed
+32
-23
lines changedLines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1398 | 1398 |
| |
1399 | 1399 |
| |
1400 | 1400 |
| |
1401 |
| - | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
1402 | 1405 |
| |
1403 |
| - | |
| 1406 | + | |
| 1407 | + | |
1404 | 1408 |
| |
1405 | 1409 |
| |
1406 | 1410 |
| |
|
Lines changed: 26 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
690 | 690 |
| |
691 | 691 |
| |
692 | 692 |
| |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
693 | 711 |
| |
694 | 712 |
| |
695 | 713 |
| |
| |||
700 | 718 |
| |
701 | 719 |
| |
702 | 720 |
| |
| 721 | + | |
| 722 | + | |
| 723 | + | |
703 | 724 |
| |
704 | 725 |
| |
705 | 726 |
| |
706 | 727 |
| |
707 |
| - | |
| 728 | + | |
| 729 | + | |
708 | 730 |
| |
709 | 731 |
| |
710 | 732 |
| |
| |||
758 | 780 |
| |
759 | 781 |
| |
760 | 782 |
| |
761 |
| - | |
762 |
| - | |
| 783 | + | |
| 784 | + | |
763 | 785 |
| |
764 | 786 |
| |
765 |
| - | |
766 |
| - | |
767 |
| - | |
768 |
| - | |
769 |
| - | |
770 |
| - | |
771 |
| - | |
772 |
| - | |
773 |
| - | |
774 |
| - | |
775 |
| - | |
776 |
| - | |
777 |
| - | |
778 |
| - | |
779 |
| - | |
780 |
| - | |
781 |
| - | |
782 |
| - | |
| 787 | + | |
783 | 788 |
| |
784 | 789 |
| |
785 | 790 |
| |
|
0 commit comments
Comments
(0)