sijie closed pull request #2374: [tiered storage] Pulsar standalone hangs when
s3 offloader is enabled
URL: https://github.com/apache/incubator-pulsar/pull/2374
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
index f6319aeaa7..103ff0f276 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
@@ -663,21 +663,25 @@ public LedgerOffloader getManagedLedgerOffloader() {
public synchronized LedgerOffloader
createManagedLedgerOffloader(ServiceConfiguration conf)
throws PulsarServerException {
- if (conf.getManagedLedgerOffloadDriver() != null
- &&
BlobStoreManagedLedgerOffloader.driverSupported(conf.getManagedLedgerOffloadDriver()))
{
- try {
- return BlobStoreManagedLedgerOffloader.create(
- getTieredStorageConf(conf),
- ImmutableMap.of(
- METADATA_SOFTWARE_VERSION_KEY.toLowerCase(),
PulsarBrokerVersionStringUtils.getNormalizedVersionString(),
- METADATA_SOFTWARE_GITSHA_KEY.toLowerCase(),
PulsarBrokerVersionStringUtils.getGitSha()
- ),
- getOffloaderScheduler(conf));
- } catch (IOException ioe) {
- throw new PulsarServerException(ioe.getMessage(),
ioe.getCause());
+ try {
+ if (conf.getManagedLedgerOffloadDriver() != null
+ &&
BlobStoreManagedLedgerOffloader.driverSupported(conf.getManagedLedgerOffloadDriver()))
{
+ try {
+ return BlobStoreManagedLedgerOffloader.create(
+ getTieredStorageConf(conf),
+ ImmutableMap.of(
+ METADATA_SOFTWARE_VERSION_KEY.toLowerCase(),
PulsarBrokerVersionStringUtils.getNormalizedVersionString(),
+ METADATA_SOFTWARE_GITSHA_KEY.toLowerCase(),
PulsarBrokerVersionStringUtils.getGitSha()
+ ),
+ getOffloaderScheduler(conf));
+ } catch (IOException ioe) {
+ throw new PulsarServerException(ioe.getMessage(),
ioe.getCause());
+ }
+ } else {
+ return NullLedgerOffloader.INSTANCE;
}
- } else {
- return NullLedgerOffloader.INSTANCE;
+ } catch (Throwable t) {
+ throw new PulsarServerException(t);
}
}
diff --git a/tiered-storage/jcloud/pom.xml b/tiered-storage/jcloud/pom.xml
index 4c4bc39aee..eb4636f634 100644
--- a/tiered-storage/jcloud/pom.xml
+++ b/tiered-storage/jcloud/pom.xml
@@ -42,6 +42,32 @@
<groupId>org.apache.pulsar</groupId>
<artifactId>jclouds-shaded</artifactId>
<version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.jclouds</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.jclouds.api</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.jclouds.common</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.jclouds.provider</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
@@ -54,5 +80,51 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
+
+ <!-- we excluded the transitive dependencies above to make it work for
standalone.
+ however it will cause test failures. bring following dependencies
back for testing.
+ all these should be gone once we introduce NAR package for
offloaders. -->
+ <dependency>
+ <groupId>com.jamesmurty.utils</groupId>
+ <artifactId>java-xmlbuilder</artifactId>
+ <version>1.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.iharder</groupId>
+ <artifactId>base64</artifactId>
+ <version>2.3.8</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>2.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>aopalliance</groupId>
+ <artifactId>aopalliance</artifactId>
+ <version>1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.errorprone</groupId>
+ <artifactId>error_prone_annotations</artifactId>
+ <version>2.1.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services