Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l46vE-0007MW-2u for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Jan 2021 18:49:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l46vC-0003Uj-SE for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Jan 2021 18:49:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l46vC-0003Uc-LH for pgsql-hackers@lists.postgresql.org; Mon, 25 Jan 2021 18:49:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l46vA-0003OA-C9 for pgsql-hackers@lists.postgresql.org; Mon, 25 Jan 2021 18:49:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 10PIn12r1894699; Mon, 25 Jan 2021 13:49:01 -0500 From: Tom Lane To: Stephen Frost cc: Jacob Champion , pgsql-hackers@lists.postgresql.org Subject: Re: Fixing cache pollution in the Kerberos test suite In-reply-to: <20210125183645.GF27507@tamriel.snowman.net> References: <1fcb175bafef6560f47a8c31229fa7c938486b8d.camel@vmware.com> <20210125183645.GF27507@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Mon, 25 Jan 2021 13:36:46 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1894697.1611600541.1@sss.pgh.pa.us> Date: Mon, 25 Jan 2021 13:49:01 -0500 Message-ID: <1894698.1611600541@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Stephen Frost writes: > * Jacob Champion (pchampion@vmware.com) wrote: >> I was running tests with a GSS-enabled stack, and ran into some very >> long psql timeouts after running the Kerberos test suite. It turns out >> the suite pushes test credentials into the user's global cache, and >> these no-longer-useful credentials persist after the suite has >> finished. (You can see this in action by running the test/kerberos >> suite and then running `klist`.) This leads to long hangs, I assume >> while the GSS implementation tries to contact a KDC that no longer >> exists. >> Attached is a patch that initializes a local credentials cache inside >> tmp_check/krb5cc, and tells psql to use it via the KRB5CCNAME envvar. >> This prevents the global cache pollution. WDYT? > Ah, yeah, that generally seems like a good idea. Yeah, changing global state is just awful. However, I don't actually see any change here (RHEL8): $ klist klist: Credentials cache 'KCM:1001' not found $ make check ... Result: PASS $ klist klist: Credentials cache 'KCM:1001' not found I suppose in an environment where someone was really using Kerberos, the random kinit would be more of a problem. Also, why are you only setting the ENV variable within narrow parts of the test script? I'd be inclined to enforce it throughout. regards, tom lane