Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111521 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 10108 invoked from network); 14 Aug 2020 19:16:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Aug 2020 19:16:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7DAD6180543 for ; Fri, 14 Aug 2020 11:16:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FREEMAIL_REPLYTO, HTML_MESSAGE,HTML_OBFUSCATE_05_10,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-vk1-f173.google.com (mail-vk1-f173.google.com [209.85.221.173]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 14 Aug 2020 11:16:17 -0700 (PDT) Received: by mail-vk1-f173.google.com with SMTP id o2so2205472vkn.9 for ; Fri, 14 Aug 2020 11:16:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:from:date:message-id:subject:to; bh=J9nj1bTZg3r+tDIS7cv98A7FbVWfGdk9bs2XeO0osnI=; b=nH+Rlyr93PoAPjCuGlGiTcpFuCNkbZl59slHaEkvdd892WDMJbsEzZToGER4TmPx72 jM3/Dsqm1UwCsai4dUQxNIXeNHcDKtk0PnJWtMnqLHVNsNu2aBsb844jU+TOlYCenigz CuHNwjvF+Pg/tKJ+uSpGdM1FYHAqvtPPFArCt+NgMrcBe0E4zGQBgdBLnAE/oPJpUuQh A+qCUsCu3eQociwODWUtS5jK/+P7TATDUV6Bmtze5TkYdY6WCKvACxZWUwbKXWwWQKMb tT+bTqulDsaJ/4drx3tmGy+5NFRhHtc705Cey7xTHLXmPJA35dOU0x3qdf/kQAgXbRLT 77KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=J9nj1bTZg3r+tDIS7cv98A7FbVWfGdk9bs2XeO0osnI=; b=NiUiQdxBR2YTkUMV8oTdnVuWJ+zChLewn7v/B0rS8SXDsqe6yOkYSM1dwjAPo8tCtM hICsQOgxXF8kvRtezV7vHP9xFZ0xFR64AwpKury8wBQJO4Z8yGYnixCqFCMyHz1Tg42e 2iTemhLZ8VZ4bHawDaD2OY5+oVOdS2Gs/fVMiebwDv691lC3yM4Vj8Uem/SrTfhLpwVf cbkSDQwsFg2a0OVRcBWYtnPntfVU4x7IydYx3z8K5bkUa5k626Wv9eaGj7/Pmn7maqVE NM3HoasYKz961Pf3hydx/VvuGdfQlkI8mvBBzIecvqhRdaNZeXGhV4TkXjv0Xz33spFX AjBg== X-Gm-Message-State: AOAM532X7Z81nWi5cVeMHVSKYlQQ9eVo+2siMSqh1ReI/89u0ABvPgAh myma70RE7oAY0rhCd92C2aEEi7X3oR+6X+cUR8CtBwtR/SA= X-Google-Smtp-Source: ABdhPJwjLtEUQ4vrin0cYwCpAEVmDcaRZe6zxJnXYrzRIHiE/Zz7kEmZ4YCYSHvy+s3UjOwjinf/L+5i+YhYD8jHtqc= X-Received: by 2002:a1f:45d1:: with SMTP id s200mr2494164vka.12.1597428976257; Fri, 14 Aug 2020 11:16:16 -0700 (PDT) MIME-Version: 1.0 Reply-To: erictnorris@gmail.com Date: Fri, 14 Aug 2020 14:16:00 -0400 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000af107705acda6a15" Subject: Proposal: Add PDO::checkLiveness method From: eric.t.norris@gmail.com (Eric Norris) --000000000000af107705acda6a15 Content-Type: text/plain; charset="UTF-8" Hey internals, I've submitted https://github.com/php/php-src/pull/5935 as a way to expose an underlying PDO driver's check_liveness function to userland scripts. Often advice given on the internet is to issue a no-op statement (e.g. SELECT 1 FROM dual), but this adds potentially unnecessary overhead and latency. Using the PDO driver's check_liveness function offers a lower-cost way of ensuring the connection is still alive. As noted in the PR, I am not tied to the method name, and open to any suggestions to making the PR better - I'm mostly interested in the underlying concept. It appears the test I added is currently failing for pgsql. I didn't have a test setup for that on hand but will look into it if there is positive feedback for this PR. Relatedly, I've also submitted https://github.com/php/php-src/pull/5947 as a way to potentially improve the mysqlnd driver's check_liveness function. Thanks! Eric Norris --000000000000af107705acda6a15--