Re: Executing inet_server_addr/port() in parallel workers

2021-01-13 Thread Masahiko Sawada
On Thu, Jan 14, 2021 at 6:24 AM Tom Lane wrote: > > I wrote: > > Having said that, I'm fine with the idea of just marking these > > parallel-restricted in HEAD and ignoring the problem in the back > > branches. > > Hearing no complaints, done that way. Although I thought that backpatching would b

Re: Executing inet_server_addr/port() in parallel workers

2021-01-13 Thread Tom Lane
I wrote: > Having said that, I'm fine with the idea of just marking these > parallel-restricted in HEAD and ignoring the problem in the back > branches. Hearing no complaints, done that way. regards, tom lane

Re: Executing inet_server_addr/port() in parallel workers

2021-01-12 Thread Tom Lane
BTW, just for the archives' sake: inet_client_addr() and inet_client_port() also access MyProcPort, so they'd also have this issue, except that they're already marked parallel-restricted. So somebody just missed the server equivalents when marking the parallel safety of built-in functions. contrib

Re: Executing inet_server_addr/port() in parallel workers

2021-01-12 Thread Tom Lane
Masahiko Sawada writes: > While investigating a customer issue it's turned out that if a > parallel worker executes inet_server_addr() and inet_server_port() the > results are always null because MyProcPort is not set in parallel > workers. Check. > To fix this issue, I think there are two optio

Executing inet_server_addr/port() in parallel workers

2021-01-12 Thread Masahiko Sawada
Hi, While investigating a customer issue it's turned out that if a parallel worker executes inet_server_addr() and inet_server_port() the results are always null because MyProcPort is not set in parallel workers. We can reproduce it in all supported versions higher than 9.6. Here is an example: p