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 1ovCMk-000560-Mh for pgsql-general@arkaria.postgresql.org; Wed, 16 Nov 2022 06:57:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ovCMj-0003ay-IY for pgsql-general@arkaria.postgresql.org; Wed, 16 Nov 2022 06:57:45 +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 1ovCMj-0003al-4k for pgsql-general@lists.postgresql.org; Wed, 16 Nov 2022 06:57:45 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ovCMh-0001ur-6y for pgsql-general@lists.postgresql.org; Wed, 16 Nov 2022 06:57:44 +0000 Received: by mail-ed1-x533.google.com with SMTP id l11so25212355edb.4 for ; Tue, 15 Nov 2022 22:57:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=36Y9NNIg/cAvpwiM6JJLgFB+VpvtNAYqH65lFoETOdQ=; b=yN9ySL/0vZ+BhVDF3I1M9joxD6cFKcidZLnEmObTzg7o9CMkSOU4PmTRfzc+8FZBDe c99bhBkmahatDMF+VaApm3mDobC6IbVpEYqRQyAjDSXJJDoYuF9YC8kxBPEf81qVjaL1 ex/id7mBHgdqme2FTA1runfZ5xPPX6sI2ttgGC7YFIDCb0S7yzDTlAydtKCNaGvMpAA1 qVuSH6o5bGrOSNhKSExRiEA03NGEsKbOJWvgIQj7/fgEcQjFvAb8B2E4xhgv0/Xktg1H uRhWCi6F9Uh77P9FeLBgivUNnFss0mshTaNyxOSJbyc/YEw7ooZtv9hS0K40PYmpSl22 b96Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=36Y9NNIg/cAvpwiM6JJLgFB+VpvtNAYqH65lFoETOdQ=; b=lS9JAWx0XOw4/ErFGfAdv7mWgWN1PGiSUPdKhxNESptJ2s/xxMxhGHrzpMcapsJMwr I1i1ELVPppGaXjSHtmtTilRbsnmuJK67A4kCHuRUVl40flgn+kvuSIH9Ys7hcrNZB4oj MKB+Rh5BKx395MOLEagUVcItoq4eAWFpes2zj3x8I7MO4n8UXy+w9ZtfFYslQJElR5t5 yzjmWz5Fk7kPTusW3i7bWZHwFc79hv7d/wSof4Vr9YT4L5jUQKA906WP9jUr/JM9LOmd qyqwuozOJiO5d1jpEbJ2jiUJZjK2As5RzkyNsOefQJa7SVmqbHc4BnDpm8vAemM7Hmvl orIQ== X-Gm-Message-State: ANoB5pkz+mnokpphyqfjXfv6N6YvA/HjwRO0iHNIkChgrItmQyMigNax Bt9QjsHFanibF5KuODn/1ur+7Q== X-Google-Smtp-Source: AA0mqf6mYFp4uRmAwxMT3c6MTlKkOrZMITBbUk9jCpwbUSCu8BMX77IcceC94mjD70Zf3pDsCvFMHw== X-Received: by 2002:aa7:ccc2:0:b0:461:bff7:9783 with SMTP id y2-20020aa7ccc2000000b00461bff79783mr18237752edt.200.1668581862071; Tue, 15 Nov 2022 22:57:42 -0800 (PST) Received: from localhost.localdomain (178-190-170-134.adsl.highway.telekom.at. [178.190.170.134]) by smtp.gmail.com with ESMTPSA id n1-20020aa7c441000000b004638ba0ea96sm7034148edr.97.2022.11.15.22.57.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 22:57:41 -0800 (PST) Message-ID: <240a2e90ec4e940cd71e42d25435e2f3d4e6a4f9.camel@cybertec.at> Subject: Re: An I/O error occured while sending to the backend From: Laurenz Albe To: gzh , pgsql-general@lists.postgresql.org Date: Wed, 16 Nov 2022 07:57:41 +0100 In-Reply-To: <449f5c48.3136.1847ed35c08.Coremail.gzhcoder@126.com> References: <449f5c48.3136.1847ed35c08.Coremail.gzhcoder@126.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) 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 Wed, 2022-11-16 at 13:04 +0800, gzh wrote: > I have developed an application using the jdbc driver and  > connecting to a postgresql database . > The application mainly does the following two things: > ① read data from the CSV file and insert it into the database > ② perform a database query > In my application, the above ① and ② are executed asynchronously. > Everything was working fine until I increase the amount of CSV data to more than 1000. > Randomly they receive an error, the stack trace of which is below. >   > Caused by: java.net.SocketTimeoutException: Read timed out > at java.base/java.net.SocketInputStream.socketRead0(Native Method) > at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115) > at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168) > at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140) > at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478) > at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472) > at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:70) > at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1454) > at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1065) > at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:161) Well, set a longer socket timeout if you need to run long SQL statements, or tune those statements to be faster. https://jdbc.postgresql.org/documentation/use/#connection-parameters has more information about "socketTimeout". Yours, Laurenz Albe