Skip to content

Commit

Permalink
Merge pull request #43 from ramanenka/CXP-3032
Browse files Browse the repository at this point in the history
CXP-3032: Race condition during `local.buffer.dir` creation
  • Loading branch information
ramanenka authored Feb 15, 2024
2 parents 5e6180d + cee8ece commit baa5e2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ allprojects {
apply plugin: 'maven-publish'

group = 'com.spredfast.kafka.connect.s3'
version = '1.2.0'
version = '1.2.1'

apply plugin: 'java-library'
sourceCompatibility = 11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ private PartitionWriter(TopicPartition tp, SinkRecord firstRecord) throws IOExce
.orElseThrow(() -> new ConnectException("No local buffer directory configured"));

File directory = new File(localBufferDirectory);
if (!directory.exists() && !directory.mkdirs()) {
int attempts = 3;
while (attempts > 0 && !directory.exists() && !directory.mkdirs()) {
attempts--;
}
if (!directory.exists()) {
throw new ConnectException("Could not create directory " + localBufferDirectory);
}

Expand Down

0 comments on commit baa5e2c

Please sign in to comment.