racecar 2.11.0.beta2 → 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: d2abf59b968a4afc5921674e1cc54dc80fe41dcd8f7997a91f4c22c3ba50200f
4
- data.tar.gz: 547a04288867e9a111ee1c8078cb60737c56c50000798ce7c095a86d63cf2235
3
+ metadata.gz: c735414453200c4d57cf1507cdb912f0d96a779b6aaaec362f54e4fe9f8c1fbc
4
+ data.tar.gz: 22de2e18b7c68d25e1f5f68b0bbf205b6e5c3d4b66e44263f0bef51c6e09d68e
5
5
  SHA512:
6
- metadata.gz: 286512ed59dbc271f73909350208c312bd193c6690dffcebcc48a7ffaf219b08aa502768590314c055c953f42527f47cdaa0b173106cc17a650252145f4ce961
7
- data.tar.gz: fc93e1a80403fb1356cc0a2eac61af695be6c46b893ca41cc14ff47c58ccbaa27c43a59c5e1cad3e73dfcc729ff80c3c0db63deadbb12a2b2dc04b8a9691589f
6
+ metadata.gz: 26070165d58aa4d92655c695af359f96717bd2f3e21c12d722ffa14538cd3cc72e10f5fd7d53b72021000540b9f6456590908d06f50be4a893883c115de5efd3
7
+ data.tar.gz: e4243278cdb6cc71702ccbed36234b7a07a364746b0dc934a88eb0d79c0b1be25b1fbe7f751312ce716417b5e253461e772c0582ba13dc85917308e92ca2b7db
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
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
+
9
+ ## 2.11.0.beta3
10
+
11
+ * Fix bug with domain socket support
12
+
5
13
  ## 2.11.0.beta2
6
14
 
7
15
  * Add unix domain socket support for Datadog StatsD metrics
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- racecar (2.11.0.beta2)
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
data/lib/racecar/cli.rb CHANGED
@@ -159,7 +159,7 @@ module Racecar
159
159
  Datadog.configure do |datadog|
160
160
  datadog.host = config.datadog_host unless config.datadog_host.nil?
161
161
  datadog.port = config.datadog_port unless config.datadog_port.nil?
162
- datadog.socket_path = config.socket_path unless config.socket_path.nil?
162
+ datadog.socket_path = config.datadog_socket_path unless config.datadog_socket_path.nil?
163
163
  datadog.namespace = config.datadog_namespace unless config.datadog_namespace.nil?
164
164
  datadog.tags = config.datadog_tags unless config.datadog_tags.nil?
165
165
  end
@@ -159,7 +159,7 @@ module Racecar
159
159
  integer :datadog_port
160
160
 
161
161
  desc "The unix domain socket of the Datadog agent (when set takes precedence over host/port)"
162
- integer :datadog_socket_path
162
+ string :datadog_socket_path
163
163
 
164
164
  desc "The namespace to use for Datadog metrics"
165
165
  string :datadog_namespace
@@ -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.beta2"
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.beta2
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-02 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