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 1lspFW-0003vv-QG for pgsql-admin@arkaria.postgresql.org; Mon, 14 Jun 2021 16:15:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lspFV-0002kL-O7 for pgsql-admin@arkaria.postgresql.org; Mon, 14 Jun 2021 16:15:41 +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 1lspFV-0002kC-Bq for pgsql-admin@lists.postgresql.org; Mon, 14 Jun 2021 16:15:41 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lspFR-0000r6-Rh for pgsql-admin@lists.postgresql.org; Mon, 14 Jun 2021 16:15:40 +0000 Received: by mail-ej1-x62d.google.com with SMTP id ce15so17564762ejb.4 for ; Mon, 14 Jun 2021 09:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=npMDuSAEHaNt6GxY5z+Qj8zNPs8my6Uns3UFb42Rr3k=; b=tbaWh1t37cV36DAC2UXLMDZwvC1FMkGnaH89ZPOd5Luhv0NJO8GyOeP1m4dhYjlzFN 1p/Ai1vdeZAO+gbHWpyoGV1VGA1iC8pcsRhrPHrODjhxaSzCxKc5zwT2vGqv0+k/iaIM L3FilMaIf0517wK5mFjoRA69YNqurecOeOEbNe8J28VoyQB0aaW/TboB8Ob0oAI2RS4J XVYi6coCbmCDQxTfW36Y2eRWbWPSSBN3uAkHrl8b0sEtuBDJY3IBwD+WB3x17FW5fl53 XTDU0V6GUmDhZSz1K4EuT9BsIHGUEAH4RPzfZjyMf/qcfTR3CHERx+ycT2iquJ4dcwIE a5uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=npMDuSAEHaNt6GxY5z+Qj8zNPs8my6Uns3UFb42Rr3k=; b=hJpdkK176yY+wiL9eNVDeLiK5cGM374/Omfz1UqGoHqBk89b2XBh5MlBNnmnxIt7Hq R78J4xsBRgDXan7EKB77oNXGMUxrj9yvi974UI6C2k6ncDkT5PlliFmnKq97Y4zJ5DXO rEyDHFnezo6L5E9cm3a/NtNWLvtKrKy1E4NNGDqbKt1vheuyMCqbxYry5XJ+ZvWY3Db4 Hkg2//TtrI64RNWYDIlUoYbe0PUpQY6Q+hzlptrkflzPeMp0KPnLxkRDt8Qz3LHmo363 goGkU7mPTfewq7kM1ZcZrJhQ3hPh9u8sDoxonQEcPFw6HaBt9lUxf1dsehMwnXYzHkmf U7NQ== X-Gm-Message-State: AOAM532lyHSgwLWVFuefFxD2c52bn+V54+RcGWTmM7nMDRUe+Xgur4Fw 71Ln6VUPBL5475BgFKa6/2vVnA== X-Google-Smtp-Source: ABdhPJx/XLXV/ocjLpxCtr6Mq7skNTVcA76sNJ9AGxz5QDdDth8w68ZgyyUNQi10fi19BmPW0FrqHg== X-Received: by 2002:a17:906:26cb:: with SMTP id u11mr16301392ejc.385.1623687336602; Mon, 14 Jun 2021 09:15:36 -0700 (PDT) Received: from localhost.localdomain (217-149-174-218.nat.highway.telekom.at. [217.149.174.218]) by smtp.gmail.com with ESMTPSA id a19sm7698066ejk.46.2021.06.14.09.15.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 09:15:36 -0700 (PDT) Message-ID: <37bda3bc33a441557fd658afc5dfbf3000f06d49.camel@cybertec.at> Subject: Re: Kill postgresql process From: Laurenz Albe To: abbas alizadeh , pgsql-admin@lists.postgresql.org Date: Mon, 14 Jun 2021 18:15:35 +0200 In-Reply-To: <38E1E462-CA29-485F-9AC0-4339B9DB2913@yahoo.com> References: <38E1E462-CA29-485F-9AC0-4339B9DB2913.ref@yahoo.com> <38E1E462-CA29-485F-9AC0-4339B9DB2913@yahoo.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2021-06-14 at 23:41 +0800, abbas alizadeh wrote: > How we can kill the stuck process? > The process didn’t kill by pg_cancel_backend/pg_terminate_backend. > Is there any way beside of using “kill -9” or “pg_ctl kill ABRT” ? If you don't mind a little hackery, I found a simple way to terminate backends that don't react to interrupts that avoids "kill -9" and the ensuing crash recovery: - Attach to the backend with gdb. - Enter "print ProcessInterrupts()" Of course that will not work if the backend is in uninterruptible sleep (for example, stuck in an I/O operation). Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com