Skip to content

Commit

Permalink
HSEARCH-4674 Update ulimits for CockroachDB
Browse files Browse the repository at this point in the history
  • Loading branch information
marko-bekhta committed Nov 6, 2023
1 parent 111aa6a commit 66bf74d
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@
import java.time.Duration;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.function.BiConsumer;

import org.hibernate.cfg.JdbcSettings;

import com.github.dockerjava.api.model.HostConfig;
import com.github.dockerjava.api.model.Ulimit;

import org.testcontainers.containers.JdbcDatabaseContainer;
import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
Expand Down Expand Up @@ -280,7 +284,15 @@ HibernateSearchJdbcDatabaseContainer container(Path dockerfile, String name) {
.forPort( 8080 )
.forStatusCode( 200 ),
8080
).withCommand( "start-single-node --insecure" );
).withCommand( "start-single-node --insecure" )
.withStartupTimeout( EXTENDED_TIMEOUT )
.withCreateContainerCmdModifier( cmd -> {
HostConfig hostConfig = cmd.getHostConfig();
if ( hostConfig == null ) {
throw new IllegalStateException( "Host config is `null`. Cannot redefine the ulimits!" );
}
hostConfig.withUlimits( List.of( new Ulimit( "nofile", 1956L, 1956L ) ) );
} );
}
};

Expand Down

0 comments on commit 66bf74d

Please sign in to comment.