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 1q64cZ-0002D2-O1 for pgsql-general@arkaria.postgresql.org; Mon, 05 Jun 2023 07:27:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q64cY-0001Vk-KS for pgsql-general@arkaria.postgresql.org; Mon, 05 Jun 2023 07:27:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q64cY-0001Va-AC for pgsql-general@lists.postgresql.org; Mon, 05 Jun 2023 07:27:18 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q64cV-000IaT-Ez for pgsql-general@lists.postgresql.org; Mon, 05 Jun 2023 07:27:16 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-514953b3aa6so6009267a12.1 for ; Mon, 05 Jun 2023 00:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20221208.gappssmtp.com; s=20221208; t=1685950033; x=1688542033; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=6UllLiIMWmuVeQs+1V34PjsrFxpWdL2uOxE8AkNcadk=; b=d3OQ7ttyci/vdjeCFsRPOBRJgF72Jb/NpncoLdFoBtYHIty5zR3YMclcgFwSdDqu9O wDkC/wJk0MUn5Fz7tXM3Q8381+yxgLzy0hGuWGK0w33Ae3SwExwg2qD5W0LovD6kZtvr 60c11NWZ+wtbTyNUMPS1vkLT4S1EOIzmDV0OMj72mLGucZc9HiAsEkfTJlWtxlYTGUul aLj3pXtJRp1u5nW/QUx1Q5QueZG7nZWeXAekbzosLbbzaFE+X4XL5L95UJUwnWwcZZpt GjCcIJCXnigJlTjatNgu4LqI7+EnTSm6G4m7VHlF16p3Y3dM4GoRpLzkQcDGdmoEyp2n NqwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685950033; x=1688542033; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=6UllLiIMWmuVeQs+1V34PjsrFxpWdL2uOxE8AkNcadk=; b=huGmsyFTHTyxL06SAS9FUAdFetYTv0hlVrbOPWtYKsu5SQu/+zVvlPPATNLkN90MXR eKlXdjlMwzSrrX7AvWehRuGKQfuvB3U8Jvja4UvzKGORCRpFtXpcr7MjGmBzo/WdGGIB XNqL/0D9rEQcKJ5tvxkAgyczSncCbxYjZuorvHKLxouC0cr5L+jMB2K3xiJy3AX3LDOp bfb6UGsENnQYGALJfgXQGaXKBHcO3H+nKGZtAMCSa3nlGzb4lNK2C7Ngh40/fR5NH/vx 2KsI1otP+o92yXzLmYwCyyijhk3DFf8MmE/Yl5K56vsva5+FYIicYuVG5I15EZle3fsK ePWg== X-Gm-Message-State: AC+VfDzQqz1FTdxAOhtoDPRD4bGMXJajcLL0tBhvUBi+cU4/TR23UWjZ OkK+fuCFfo2R15wQRGASPrkrgQ== X-Google-Smtp-Source: ACHHUZ6RfoZyQyh5TKsFrN2yp8OEmbaclQvDhq3gmgyhs4MfIp40AzdyPDEpbEltDy+Sfi0k0K3hWw== X-Received: by 2002:aa7:d54f:0:b0:516:6779:263e with SMTP id u15-20020aa7d54f000000b005166779263emr343608edr.22.1685950033030; Mon, 05 Jun 2023 00:27:13 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:6888:bdff:4d5b:3b36:4e7b]) by smtp.gmail.com with ESMTPSA id d13-20020aa7c1cd000000b0051425ba4faasm3617995edp.50.2023.06.05.00.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 00:27:12 -0700 (PDT) Message-ID: Subject: Re: [Question]What will happen if the server active close the connection? From: Laurenz Albe To: Wen Yi <896634148@qq.com>, pgsql-general Date: Mon, 05 Jun 2023 09:27:12 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2023-06-05 at 10:18 +0800, Wen Yi wrote: > when I study the tcp connection, I found that if the server active close = the connection, > the server will send a fin package to the client and the client will repl= y a ack package. > As this: >=20 > Server ---->(FIN) Client > Server <----(ACK) Client >=20 > My question is, in so many articles, the following step is, the client wi= ll write some > data(send some data) to the server and then cause the signal SIGNALPIPE. > But what will happen if the client died?(Example: was killed by the user) If the server has already closed the connection, nothing much will happen. If the client never sends ACK to the FIN, the session will still time out. You can fiddle with the tcp_keepalives_* parameters to influence that. Yours, Laurenz Albe