From 6011cd2efd98929d2b9e96e37c1cbdf7357d0cbe Mon Sep 17 00:00:00 2001 From: gam6itko Date: Fri, 26 Jul 2024 13:26:31 +0300 Subject: [PATCH 1/4] fix services.exec_timeout schema definition --- schemas/config/2.0.schema.json | 3 ++- schemas/config/3.0.schema.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/schemas/config/2.0.schema.json b/schemas/config/2.0.schema.json index e3cdefeed..4a6c6770b 100644 --- a/schemas/config/2.0.schema.json +++ b/schemas/config/2.0.schema.json @@ -2232,8 +2232,9 @@ "Duration": { "description": "Time duration", "type": "string", - "pattern": "^[0-9]+[ms]|[s,h]", + "pattern": "^[0-9]+(h|m|s|ms)$", "examples": [ + "9999h", "10h", "1m", "1h", diff --git a/schemas/config/3.0.schema.json b/schemas/config/3.0.schema.json index 98563373b..bd418e447 100644 --- a/schemas/config/3.0.schema.json +++ b/schemas/config/3.0.schema.json @@ -2359,8 +2359,9 @@ "Duration": { "description": "Time duration", "type": "string", - "pattern": "^[0-9]+[ms]|[s,h]", + "pattern": "^[0-9]+(h|m|s|ms)$", "examples": [ + "9999h", "10h", "1m", "1h", From 0f08ba23df8dc9ec4b6a63d9852b44c8b2e36c78 Mon Sep 17 00:00:00 2001 From: gam6itko Date: Fri, 26 Jul 2024 13:47:45 +0300 Subject: [PATCH 2/4] fix schema --- schemas/config/2.0.schema.json | 2 +- schemas/config/3.0.schema.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/schemas/config/2.0.schema.json b/schemas/config/2.0.schema.json index 4a6c6770b..b90cea2cb 100644 --- a/schemas/config/2.0.schema.json +++ b/schemas/config/2.0.schema.json @@ -2232,7 +2232,7 @@ "Duration": { "description": "Time duration", "type": "string", - "pattern": "^[0-9]+(h|m|s|ms)$", + "pattern": "^[0-9]+(h|m|s|ms)", "examples": [ "9999h", "10h", diff --git a/schemas/config/3.0.schema.json b/schemas/config/3.0.schema.json index bd418e447..914ab268f 100644 --- a/schemas/config/3.0.schema.json +++ b/schemas/config/3.0.schema.json @@ -2359,7 +2359,7 @@ "Duration": { "description": "Time duration", "type": "string", - "pattern": "^[0-9]+(h|m|s|ms)$", + "pattern": "^[0-9]+(h|m|s|ms)", "examples": [ "9999h", "10h", From 5045883eb76a7c44118bbe7e1f987ef2b2b57d50 Mon Sep 17 00:00:00 2001 From: gam6itko Date: Fri, 26 Jul 2024 13:50:36 +0300 Subject: [PATCH 3/4] remove $ --- schemas/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/readme.md b/schemas/readme.md index 6ec41a46e..f4b1e0f92 100644 --- a/schemas/readme.md +++ b/schemas/readme.md @@ -7,7 +7,7 @@ This directory contains public schemas for the most important parts of applicati - You can validate existing config file using the following command: ```bash - $ docker run --rm -v "$(pwd):/src" -w "/src" node:14-alpine sh -c \ +docker run --rm -v "$(pwd):/src" -w "/src" node:14-alpine sh -c \ "npm install -g ajv-cli && \ ajv validate --all-errors --verbose \ -s ./schemas/config/2.0.schema.json \ From 216f1efad095d60ecad8d91d810541d7611e76ad Mon Sep 17 00:00:00 2001 From: gam6itko Date: Fri, 26 Jul 2024 23:16:33 +0300 Subject: [PATCH 4/4] duration fix --- .rr.yaml | 11 ++++++++--- schemas/config/2.0.schema.json | 16 +++++++++------- schemas/config/3.0.schema.json | 16 +++++++++------- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.rr.yaml b/.rr.yaml index 5bf290c3c..b5febff10 100644 --- a/.rr.yaml +++ b/.rr.yaml @@ -495,7 +495,7 @@ service: # Allowed time before stop. # - # Default: 0 (infinity), can be 1s, 2m, 2h (seconds, minutes, hours) + # Default: 0 (infinity), can be 1s, 2m, 2h (seconds, minutes, hours) and complex 2h2m1s. exec_timeout: 0s # Show the name of the service in logs (e.g. service.some_service_1) @@ -547,7 +547,7 @@ service: # Allowed time before stop. # - # Default: 0 (infinity), can be 1s, 2m, 2h (seconds, minutes, hours) + # Default: 0 (infinity), can be 1s, 2m, 2h (seconds, minutes, hours) and complex 2h2m1s. exec_timeout: 0s # Remain process after exit. In other words, restart process after exit with any exit code. @@ -1930,6 +1930,7 @@ grpc: # zero or the connection establishment. # # This option is optional. Default value: infinity. + # Can be 1s, 2m, 2h (seconds, minutes, hours) and complex 2h2m1s. max_connection_idle: 0s # MaxConnectionAge is a duration for the maximum amount of time a @@ -1938,11 +1939,13 @@ grpc: # connection storms. # # This option is optional. Default value: infinity. + # Can be 1s, 2m, 2h (seconds, minutes, hours) and complex 2h2m1s. max_connection_age: 0s # MaxConnectionAgeGrace is an additive period after MaxConnectionAge after # which the connection will be forcibly closed. - max_connection_age_grace: 0s8h + # Can be 1s, 2m, 2h (seconds, minutes, hours) and complex 2h2m1s. + max_connection_age_grace: 8h # MaxConnectionAgeGrace is an additive period after MaxConnectionAge after # which the connection will be forcibly closed. @@ -1955,6 +1958,7 @@ grpc: # If set below 1s, a minimum value of 1s will be used instead. # # This option is optional. Default value: 2h + # Can be 1s, 2m, 2h (seconds, minutes, hours) and complex 2h2m1s. ping_time: 1s # After having pinged for keepalive check, the server waits for a duration @@ -1962,6 +1966,7 @@ grpc: # closed. # # This option is optional. Default value: 20s + # Can be 1s, 2m, 2h (seconds, minutes, hours) and complex 2h2m1s. timeout: 200s # Usual workers pool configuration diff --git a/schemas/config/2.0.schema.json b/schemas/config/2.0.schema.json index b90cea2cb..9971849aa 100644 --- a/schemas/config/2.0.schema.json +++ b/schemas/config/2.0.schema.json @@ -2232,14 +2232,16 @@ "Duration": { "description": "Time duration", "type": "string", - "pattern": "^[0-9]+(h|m|s|ms)", + "pattern": "^([0-9]*(\\.[0-9]*)?(ms|h|m|s))+$", "examples": [ - "9999h", - "10h", - "1m", - "1h", - "30s", - "300ms" + "1h", + "2.5h", + "2m", + ".2m", + "30s", + "30.03s", + "300ms", + "1h3m40s500ms" ] }, "HostAndPortWithTCP": { diff --git a/schemas/config/3.0.schema.json b/schemas/config/3.0.schema.json index 914ab268f..f65e86cb8 100644 --- a/schemas/config/3.0.schema.json +++ b/schemas/config/3.0.schema.json @@ -2359,15 +2359,17 @@ "Duration": { "description": "Time duration", "type": "string", - "pattern": "^[0-9]+(h|m|s|ms)", + "pattern": "^([0-9]*(\\.[0-9]*)?(ms|h|m|s))+$", "examples": [ - "9999h", - "10h", - "1m", - "1h", + "1h", + "2.5h", + "2m", + ".2m", "30s", - "300ms" - ] + "30.03s", + "300ms", + "1h3m40s500ms" + ] }, "HostAndPortWithTCP": { "description": "Host and port with tcp:// prefix",