From 04c2d42a58ac3250a10bea198a2cefd432ed8229 Mon Sep 17 00:00:00 2001 From: Dong Liang Date: Tue, 23 Apr 2019 15:39:09 -0700 Subject: [PATCH 1/3] Add arcconfig --- .arcconfig | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .arcconfig diff --git a/.arcconfig b/.arcconfig new file mode 100644 index 0000000000..deb96d33e0 --- /dev/null +++ b/.arcconfig @@ -0,0 +1,3 @@ +{ + "phabricator.uri": "https://phabricator.rubrik.com/" +} From e677efc6a2368c830d569f7e1cbcc25d682ffa61 Mon Sep 17 00:00:00 2001 From: Dong Liang Date: Fri, 12 Apr 2019 13:46:31 -0700 Subject: [PATCH 2/3] fix: set socket timeout for ssl handshake Summary: Details of the issue can be found in: https://github.com/pgjdbc/pgjdbc/issues/1468 PR: https://github.com/pgjdbc/pgjdbc/pull/1469 Test Plan: Run manual tests with and without the fix. Verify that the fix did prevent the issue from happening. Reviewers: #callisto, garvit Reviewed By: #callisto, garvit Tags: #callisto JIRA Issues: CDM-110595 Differential Revision: https://phabricator.rubrik.com/D87384 --- .../org/postgresql/core/v3/ConnectionFactoryImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pgjdbc/src/main/java/org/postgresql/core/v3/ConnectionFactoryImpl.java b/pgjdbc/src/main/java/org/postgresql/core/v3/ConnectionFactoryImpl.java index 0ffc9e56f5..b413b0480f 100644 --- a/pgjdbc/src/main/java/org/postgresql/core/v3/ConnectionFactoryImpl.java +++ b/pgjdbc/src/main/java/org/postgresql/core/v3/ConnectionFactoryImpl.java @@ -99,6 +99,15 @@ private PGStream tryConnect(String user, String database, // Set the socket timeout if the "socketTimeout" property has been set. int socketTimeout = PGProperty.SOCKET_TIMEOUT.getInt(info); + if (socketTimeout > 0) { + newStream.getSocket().setSoTimeout(socketTimeout * 1000); + } + + // Construct and send an ssl startup packet if requested. + newStream = enableSSL(newStream, sslMode, info, connectTimeout); + + // Set the socket timeout for newStream again because enableSSL might return + // a PGStream different from previous newStream. if (socketTimeout > 0) { newStream.setNetworkTimeout(socketTimeout * 1000); } From 0c744fa1de2529199a2906fbc38054653fc5e17c Mon Sep 17 00:00:00 2001 From: sanjanamallikarjuna Date: Sun, 8 Jun 2025 19:58:25 +0000 Subject: [PATCH 3/3] Building pgjdbc version 42.2.29-rubrik --- bom/build.gradle.kts | 1 + build.gradle.kts | 53 ++++++++++++++++++- .../org/postgresql/util/StreamWrapper.java | 7 --- 3 files changed, 52 insertions(+), 9 deletions(-) diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts index 13e4f1e421..571ab2c25a 100644 --- a/bom/build.gradle.kts +++ b/bom/build.gradle.kts @@ -5,6 +5,7 @@ plugins { `java-platform` + `maven-publish` } val String.v: String get() = rootProject.extra["$this.version"] as String diff --git a/build.gradle.kts b/build.gradle.kts index 9791676352..dc49a95415 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -36,7 +36,7 @@ plugins { id("com.github.vlsi.crlf") id("com.github.vlsi.gradle-extensions") id("com.github.vlsi.license-gather") apply false - id("com.github.vlsi.stage-vote-release") + id("com.github.vlsi.stage-vote-release") version "1.90" } fun reportsForHumans() = !(System.getenv()["CI"]?.toBoolean() ?: props.bool("CI")) @@ -49,6 +49,7 @@ val enableCheckerframework by props() val skipCheckstyle by props() val skipAutostyle by props() val skipJavadoc by props() +val skipSources by props() val skipForbiddenApis by props() val enableMavenLocal by props() val enableGradleMetadata by props() @@ -83,7 +84,7 @@ val gitProps by tasks.registering(FindGitAttributes::class) { val String.v: String get() = rootProject.extra["$this.version"] as String -val buildVersion = "pgjdbc".v + releaseParams.snapshotSuffix +val buildVersion = "pgjdbc".v + "-rubrik" println("Building pgjdbc $buildVersion") @@ -727,3 +728,51 @@ subprojects { } } } + +subprojects { + plugins.apply(if (project.name == "bom") "java-platform" else "java-library") + + repositories { + mavenCentral() + } + + plugins.withType { + configure { + if (!skipSources) withSourcesJar() + if (!skipJavadoc) withJavadocJar() + } + } + + plugins.withType { + configure { + allowDependencies() + } + } + + plugins.withType { + publishing { + publications { + create("mavenJava") { + from( + if (plugins.hasPlugin("java-platform")) + components["javaPlatform"] + else components["java"] + ) + + artifactId = project.name + } + } + + repositories { + maven { + name = "repository.rubrik.com-releases" + url = uri("https://repository.rubrik.com:443/artifactory/rubrik-maven2-local") + credentials { + username = System.getenv("RUBRIK_MAVEN_USER") + password = System.getenv("RUBRIK_MAVEN_API_KEY") + } + } + } + } + } +} diff --git a/pgjdbc/src/main/java/org/postgresql/util/StreamWrapper.java b/pgjdbc/src/main/java/org/postgresql/util/StreamWrapper.java index f25fd5a29f..1f5907c8c9 100644 --- a/pgjdbc/src/main/java/org/postgresql/util/StreamWrapper.java +++ b/pgjdbc/src/main/java/org/postgresql/util/StreamWrapper.java @@ -17,9 +17,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -//#if mvn.project.property.postgresql.jdbc.spec >= "JDBC4.1" -import java.nio.file.Files; -//#endif /** * Wrapper around a length-limited InputStream. @@ -55,11 +52,7 @@ public StreamWrapper(InputStream stream) throws PSQLException { if (memoryLength == -1) { final int diskLength; final File tempFile = - //#if mvn.project.property.postgresql.jdbc.spec >= "JDBC4.1" - Files.createTempFile(TEMP_FILE_PREFIX, null).toFile(); - //#else File.createTempFile(TEMP_FILE_PREFIX, null); - //#endif FileOutputStream diskOutputStream = new FileOutputStream(tempFile); diskOutputStream.write(rawData); try {