racecar 2.11.0.beta3 → 2.11.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e94370f7438cb989f00b1b70148c97b2eb57f84aad477512829ba4160c95be4
4
- data.tar.gz: 4ead1f9cd7628c2e93cce9d1485278b582c38f69c9ddcd6f84881f1b6ab61056
3
+ metadata.gz: c735414453200c4d57cf1507cdb912f0d96a779b6aaaec362f54e4fe9f8c1fbc
4
+ data.tar.gz: 22de2e18b7c68d25e1f5f68b0bbf205b6e5c3d4b66e44263f0bef51c6e09d68e
5
5
  SHA512:
6
- metadata.gz: d86c13aadbf50bca785536e15cc26b8e77bd5d59ea36f12ea5e101974e1740c0a1fc074ba37140a7a2bf1f4d74e44a326a212d03206c78bc5f539fcb3b5df519
7
- data.tar.gz: 06f57db93326633d4da9cdd671444a1cd71e9411fc7733ad0a8b654e184fdb311757ee4e6bf6f3897d39a0db3f0895ec6eb5b9e31beec1f53a73380bfee0dd8a
6
+ metadata.gz: 26070165d58aa4d92655c695af359f96717bd2f3e21c12d722ffa14538cd3cc72e10f5fd7d53b72021000540b9f6456590908d06f50be4a893883c115de5efd3
7
+ data.tar.gz: e4243278cdb6cc71702ccbed36234b7a07a364746b0dc934a88eb0d79c0b1be25b1fbe7f751312ce716417b5e253461e772c0582ba13dc85917308e92ca2b7db
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.11.0.beta4
6
+
7
+ * Allow the liveness probe command to skip loading config files
8
+
5
9
  ## 2.11.0.beta3
6
10
 
7
11
  * Fix bug with domain socket support
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- racecar (2.11.0.beta3)
4
+ racecar (2.11.0.beta4)
5
5
  king_konf (~> 1.0.0)
6
6
  rdkafka (~> 0.15.0)
7
7
 
data/README.md CHANGED
@@ -542,15 +542,14 @@ While `maxSurge` should always be 0, `maxUnavailable` can be increased to reduce
542
542
  Racecar comes with a built-in liveness probe, primarily for use with Kubernetes, but useful for any deployment environment where you can periodically run a process to check the health of your consumer.
543
543
 
544
544
  To use this feature:
545
- - set the `liveness_probe_enabled` config option to true.
546
- - configure your Kubernetes deployment to run `$ racecarctl liveness_probe`
545
+ 1. Set the `liveness_probe_enabled` config option to true.
546
+ 2. Configure your Kubernetes deployment liveness probe to run this command `$ racecarctl liveness_probe`
547
547
 
548
-
549
- When enabled (see config) Racecar will touch the file at `liveness_probe_file_path` each time it finishes polling Kafka and processing the messages in the batch (if any).
548
+ When enabled (see config) Racecar will touch the file at the specified path each time it finishes polling Kafka and processing the messages in the batch (if any).
550
549
 
551
550
  The modified time of this file can be observed to determine when the consumer last exhibited 'liveness'.
552
551
 
553
- Running `racecarctl liveness_probe` will return a successful exit status if the last 'liveness' event happened within an acceptable time, `liveness_probe_max_interval`.
552
+ Running `racecarctl liveness_probe` will return a successful exit status if the last 'liveness' event happened within an acceptable time, which you can set as `liveness_probe_max_interval`.
554
553
 
555
554
  `liveness_probe_max_interval` should be long enough to account for both the Kafka polling time of `max_wait_time` and the processing time of a full message batch.
556
555
 
@@ -558,9 +557,15 @@ On receiving `SIGTERM`, Racecar will gracefully shut down and delete this file,
558
557
 
559
558
  You may wish to tolerate more than one failed probe run to accommodate for environmental variance and clock changes.
560
559
 
561
- See the [Configuration section](https://github.com/zendesk/racecar#configuration) for the various ways the liveness probe can be configured, environment variables being one option.
560
+ The [Configuration section](https://github.com/zendesk/racecar#configuration) for the various ways the liveness probe can be configured. (We recommend environment variables).
561
+
562
+ ##### Slow racecar.rb / racecar.yml? Skip config files!
563
+
564
+ If your config files need to do something expensive, such as load Rails, you can enable `RACECAR_LIVENESS_PROBE_SKIP_CONFIG_FILES`. The liveness probe command will then skip loading your configuration and execute quickly.
562
565
 
563
- Here is an example Kubernetes liveness probe configuration:
566
+ Most other configuration values can be set via the environment, we recommend you do this for liveness probe settings.
567
+
568
+ ##### Example Kubernetes Configuration
564
569
 
565
570
  ```yaml
566
571
  apiVersion: apps/v1
@@ -576,8 +581,15 @@ spec:
576
581
  - SomeConsumer
577
582
 
578
583
  env:
584
+ # Skip config loading to run fast, only the following values are needed
585
+ - name: RACECAR_LIVENESS_PROBE_SKIP_CONFIG_FILES
586
+ value: "true"
579
587
  - name: RACECAR_LIVENESS_PROBE_ENABLED
580
588
  value: "true"
589
+ - name: RACECAR_LIVENESS_PROBE_FILE_PATH
590
+ value: "/tmp/racecar-liveness"
591
+ - name: RACECAR_LIVENESS_PROBE_MAX_INTERVAL
592
+ value: "5"
581
593
 
582
594
  livenessProbe:
583
595
  exec:
@@ -585,8 +597,8 @@ spec:
585
597
  - racecarctl
586
598
  - liveness_probe
587
599
 
588
- # Allow up to 10 consecutive failures before terminating Pod:
589
- failureThreshold: 10
600
+ # Allow up to 3 consecutive failures before terminating Pod:
601
+ failureThreshold: 3
590
602
 
591
603
  # Wait 30 seconds before starting the probes:
592
604
  initialDelaySeconds: 30
@@ -188,6 +188,9 @@ module Racecar
188
188
  desc "Used only by the liveness probe: Max time (in seconds) between liveness events before the process is considered not healthy"
189
189
  integer :liveness_probe_max_interval, default: 5
190
190
 
191
+ desc "Allows the liveness probe command to skip loading config files. When enabled, configure liveness probe values via environmental variables. Defaults still apply. Only applies to the liveness probe command."
192
+ boolean :liveness_probe_skip_config_files, default: false
193
+
191
194
  desc "Strategy for switching topics when there are multiple subscriptions. `exhaust-topic` will only switch when the consumer poll returns no messages. `round-robin` will switch after each poll regardless.\nWarning: `round-robin` will be the default in Racecar 3.x"
192
195
  string :multi_subscription_strategy, allowed_values: %w(round-robin exhaust-topic), default: "exhaust-topic"
193
196
 
data/lib/racecar/ctl.rb CHANGED
@@ -36,12 +36,14 @@ module Racecar
36
36
  require "racecar/liveness_probe"
37
37
  parse_options!(args)
38
38
 
39
- if ENV["RAILS_ENV"] && File.exist?("config/racecar.yml")
40
- Racecar.config.load_file("config/racecar.yml", ENV["RAILS_ENV"])
41
- end
39
+ unless config.liveness_probe_skip_config_files
40
+ if File.exist?("config/racecar.rb")
41
+ require "./config/racecar"
42
+ end
42
43
 
43
- if File.exist?("config/racecar.rb")
44
- require "./config/racecar"
44
+ if ENV["RAILS_ENV"] && File.exist?("config/racecar.yml")
45
+ Racecar.config.load_file("config/racecar.yml", ENV["RAILS_ENV"])
46
+ end
45
47
  end
46
48
 
47
49
  Racecar.config.liveness_probe.check_liveness_within_interval!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Racecar
4
- VERSION = "2.11.0.beta3"
4
+ VERSION = "2.11.0.beta4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: racecar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.0.beta3
4
+ version: 2.11.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schierbeck
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-04-08 00:00:00.000000000 Z
12
+ date: 2024-05-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: king_konf
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  - !ruby/object:Gem::Version
230
230
  version: '0'
231
231
  requirements: []
232
- rubygems_version: 3.5.3
232
+ rubygems_version: 3.5.9
233
233
  signing_key:
234
234
  specification_version: 4
235
235
  summary: A framework for running Kafka consumers