Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZh9K-0005H9-Ue for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Jul 2017 17:28:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dZh9K-0006z1-Hb for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Jul 2017 17:28:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dZh9J-0006vT-Ha for pgsql-hackers@postgresql.org; Mon, 24 Jul 2017 17:28:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dZh9H-0006PS-1x for pgsql-hackers@postgresql.org; Mon, 24 Jul 2017 17:28:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v6OHRw4Q032760; Mon, 24 Jul 2017 13:27:58 -0400 From: Tom Lane To: Andres Freund cc: Julien Rouhaud , pgsql-hackers Subject: Re: segfault in HEAD when too many nested functions call In-reply-to: <20170724161954.gbqswhukk7c4lygt@alap3.anarazel.de> References: <12302.1500132157@sss.pgh.pa.us> <20170717072629.dqykbsot2irdob7c@alap3.anarazel.de> <20170717145710.cm32m4yn555hsoxd@alap3.anarazel.de> <6687.1500411223@sss.pgh.pa.us> <20170721114023.fj6cvr6og46yogei@alap3.anarazel.de> <19899.1500682674@sss.pgh.pa.us> <20170724161954.gbqswhukk7c4lygt@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 24 Jul 2017 09:19:54 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32758.1500917278.1@sss.pgh.pa.us> Date: Mon, 24 Jul 2017 13:27:58 -0400 Message-ID: <32759.1500917278@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andres Freund writes: > On 2017-07-21 20:17:54 -0400, Tom Lane wrote: >>> I dislike having the miscadmin.h include in executor.h - but I don't >>> quite see a better alternative. >> I seriously, seriously, seriously dislike that. You practically might as >> well put miscadmin.h into postgres.h. Instead, what do you think of >> requiring the individual ExecProcNode functions to perform >> CHECK_FOR_INTERRUPTS? Since they're already responsible for doing that >> if they have any long-running internal loops, this doesn't seem like a >> modularity violation. It is a risk for bugs-of-omission, sure, but so >> are a lot of other things that the per-node code has to do. > That'd work. Another alternative would be to move the inline definition > of ExecProcNode() (and probably a bunch of other related functions) into > a more internals oriented header. It seems likely that we're going to > add more inline functions to the executor, and that'd reduce the > coupling of external and internal users a bit. Well, it still ends up that the callers of ExecProcNode need to include miscadmin.h, whereas if we move it into the per-node functions, then the per-node files need to include miscadmin.h. I think the latter is better because those files may need to have other CHECK_FOR_INTERRUPTS calls anyway. It's less clear from a modularity standpoint that executor callers should need miscadmin.h. (Or in short, I'm not really okay with *any* header file including miscadmin.h.) >> * I think the comments need more work. Am willing to make a pass over >> that if you want. > That'd be good, but let's wait till we have something more final. Agreed, I'll wait till you produce another version. >> * Can we redefine the ExecCustomScan function pointer as type >> ExecProcNodeCB, eliminating the unsightly cast in nodeCustom.c? > That'd change an "extension API", which is why I skipped it at this > point of the release cycle. It's not like we didn't have this type of > cast all over before. Ok, with changing it, but that's where I came > down. Is this patch really not changing anything else that a custom-scan extension would touch? If not, I'm okay with postponing this bit of cleanup to v11. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers