sqewer 9.0.0 → 10.0.0

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: a77289a915370519a947d35eca6c37eaca54fd319a1bb47cf9ab6889d509a3d0
4
- data.tar.gz: dfb8c88266e50af819c66c93c56fffebb14f675f6e6f8ec4c8869f1e2a7a6edb
3
+ metadata.gz: 4fd3e716de2cc1860f1c1638f8cfe0f21b965c82b0026c1315eb13c8668b5056
4
+ data.tar.gz: a727f9e4e226811b7553efe1daff8bda680ac03a61bc37f6c3c2020b410b7351
5
5
  SHA512:
6
- metadata.gz: 89cf6418255c49a5ddb83d27bcf8e8bca8c017dc15cad9e6fd77a41cb44b795400f474667b72bc3c6849792dabbd6742be07bc90c4fa441659166749a8b55fbd
7
- data.tar.gz: 71e0f5ee37e30ee4729179da5c29eb231c527b9f7e7415ae11ae2109e6ac2ef7e6ecaeebf38c14f1de70a9fb9892570c1f6abb531fcf340fe74a1ea079dce698
6
+ metadata.gz: 036f10c4debed8416fe639adcfc3e7f38d1e9fc4825f01892e98d518997823b7c1291f6ad51190d3f79f49027d843862b3b92f79c0f4da73f1bebbea3078e6c8
7
+ data.tar.gz: 0cc332e0f3ab31d02254356b33c3b097cf0700f259f87ed63734a61d9df47817b119fa3f7f8ddd427ed624ea1ee72b7bd0a25105127273392cb906693c520f21
@@ -0,0 +1 @@
1
+ * @WeTransfer/WeTransfer-CodeOwners
@@ -0,0 +1,16 @@
1
+ ---
2
+ version: 2
3
+ updates:
4
+ - package-ecosystem: github-actions
5
+ directory: /
6
+ schedule:
7
+ interval: daily
8
+ time: "10:00"
9
+ timezone: Europe/Amsterdam
10
+ - package-ecosystem: bundler
11
+ directory: /
12
+ registries: "*"
13
+ schedule:
14
+ interval: daily
15
+ time: "09:00"
16
+ timezone: Europe/Amsterdam
@@ -19,14 +19,14 @@ jobs:
19
19
  SQS_QUEUE_URL: 'sqlite3://tmp/sqewer.sqlite3'
20
20
  AWS_REGION: 'eu-central-1'
21
21
  steps:
22
- - uses: actions/checkout@v2
22
+ - uses: actions/checkout@v4
23
23
  - name: Set up Ruby
24
24
  uses: ruby/setup-ruby@v1
25
25
  with:
26
26
  ruby-version: ${{ matrix.ruby }}
27
27
  - name: install gems
28
28
  run: |
29
- gem install sqlite3
29
+ gem install sqlite3 -v '~> 1.0'
30
30
  gem install bundler
31
31
  bundle install --gemfile ${{ matrix.gemfile }}
32
32
  - name: Tests
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ### 10.0.0
2
+ - Ensure all worker threads exit if a thread dies in case of an unhandled exception, to avoid "zombie" workers (running without any consumer thread)
3
+
1
4
  ### 9.0.0
2
5
  - Add support for Ruby 3.2 and Rails 7
3
6
  - Remove support for Ruby 2.6, 2.7 and Rails 5 and 6.0
@@ -1,3 +1,3 @@
1
1
  module Sqewer
2
- VERSION = '9.0.0'
2
+ VERSION = '10.0.0'
3
3
  end
data/lib/sqewer/worker.rb CHANGED
@@ -89,8 +89,14 @@ class Sqewer::Worker
89
89
  @logger.info { '[worker] Starting with %d consumer threads' % @num_threads }
90
90
  @execution_queue = Queue.new
91
91
 
92
- consumers = (1..@num_threads).map do
92
+ # Ensure that unhandled exceptions inside threads make the worker fail,
93
+ # to avoid silent failures with no consumer threads running.
94
+ Thread.abort_on_exception = true
95
+
96
+ consumers = (1..@num_threads).each_with_index.map do |_, index|
93
97
  Thread.new do
98
+ Thread.current[:role] = :consumer
99
+ Thread.current[:id] = index
94
100
  loop { take_and_execute }
95
101
  end
96
102
  end
@@ -99,6 +105,7 @@ class Sqewer::Worker
99
105
  # grab new messages and place them on the local queue.
100
106
  owning_worker = self # self won't be self anymore in the thread
101
107
  provider = Thread.new do
108
+ Thread.current[:role] = :provider
102
109
  loop do
103
110
  begin
104
111
  break if stopping?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.0
4
+ version: 10.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-09-19 00:00:00.000000000 Z
12
+ date: 2024-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk-sqs
@@ -246,9 +246,11 @@ executables:
246
246
  extensions: []
247
247
  extra_rdoc_files: []
248
248
  files:
249
+ - ".github/CODEOWNERS"
249
250
  - ".github/ISSUE_TEMPLATE/bug_report.md"
250
251
  - ".github/ISSUE_TEMPLATE/feature_request.md"
251
252
  - ".github/PULL_REQUEST_TEMPLATE.md"
253
+ - ".github/dependabot.yml"
252
254
  - ".github/workflows/main.yml"
253
255
  - ".gitignore"
254
256
  - ".yardopts"
@@ -302,7 +304,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
304
  - !ruby/object:Gem::Version
303
305
  version: '0'
304
306
  requirements: []
305
- rubygems_version: 3.4.10
307
+ rubygems_version: 3.5.17
306
308
  signing_key:
307
309
  specification_version: 4
308
310
  summary: Process jobs from SQS