diff --git a/scripts/warmup-eagle.sh b/scripts/warmup-eagle.sh index c4256312c7..4171b933b5 100755 --- a/scripts/warmup-eagle.sh +++ b/scripts/warmup-eagle.sh @@ -65,7 +65,8 @@ fi # If we found the Go tool, use it if [ -n "${WARMUP_TOOL}" ]; then log_info "Using Go warmup tool: ${WARMUP_TOOL}" - if "${WARMUP_TOOL}" --address="${HOST}" --timeout=60s; then + # Use 5 minute timeout to allow for slow operations on cold JVM + if "${WARMUP_TOOL}" --address="${HOST}" --timeout=300s; then log_info "Warmup complete!" exit 0 else diff --git a/src/main/go/net/eagle0/warmup/main.go b/src/main/go/net/eagle0/warmup/main.go index 04fa818666..fd9135d884 100644 --- a/src/main/go/net/eagle0/warmup/main.go +++ b/src/main/go/net/eagle0/warmup/main.go @@ -396,8 +396,9 @@ done: } // waitForResponse waits for a response matching the predicate +// Use 90s timeout because CreateGame can be slow on cold JVM (JIT not warmed up) func waitForResponse(stream eagle.Eagle_StreamUpdatesClient, matches func(*eagle.UpdateStreamResponse) bool) (*eagle.UpdateStreamResponse, error) { - return waitForResponseWithTimeout(stream, matches, 30*time.Second) + return waitForResponseWithTimeout(stream, matches, 90*time.Second) } func waitForResponseWithTimeout(stream eagle.Eagle_StreamUpdatesClient, matches func(*eagle.UpdateStreamResponse) bool, timeout time.Duration) (*eagle.UpdateStreamResponse, error) {