async-container 0.34.5 → 0.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -3
- data/lib/async/container/generic.rb +9 -0
- data/lib/async/container/hybrid.rb +8 -7
- data/lib/async/container/version.rb +1 -1
- data/readme.md +24 -11
- data/releases.md +8 -0
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 293edf1aac3945b8751879fe8b8180e7fb9bcc769f5b1bea315687f19d33ea11
|
|
4
|
+
data.tar.gz: 60699b17d30ce273a236b0728246a10fb7bb47691d3f2b3827a0bc08c51fa097
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2febcb62a2cdce3e43e92fa0d39a943bb92ade5ef0af9401810853fdb27bca98805a75d029926bbf61de0a130da293169fc9533d091d74cd11c0d01f0ee5c296
|
|
7
|
+
data.tar.gz: 909529d757ada40f2501f96455df4f4ecad4a739365b52ef35ef77ae449c9b6869351a73cb28e0c335ef0793fed2c35656a9e6218e1b79da73fec5d4a8b09e9c
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
��O��[�4�"�ɿw� ��'fR8�V'��Q;u�K��xy�w� Yɥ�b�N��h����6R���s�֨����-�g�(1�o?�d�e����=$OYv�-�7縦W8�f^�eI��ư9�H�3�A|̂�����]�W�ь�]����i�6���\�X�䶎�.֤�Ίʫ h�)F|����N����^7���U{�7>K���M�VI�o�C�/�%�kn�@�i�vכ&R|�����~�3
|
|
3
|
-
��/�qu���Yi�^�ֹ�.��+qbRR�w�\�
|
|
1
|
+
>kSL�쀉D�"ɏ�}���@e%�������WʼZ]LK��t�8R!C�K�D���:0/l�2��\4ݵ]��w��� �t
|
|
@@ -115,6 +115,15 @@ module Async
|
|
|
115
115
|
@group.wait
|
|
116
116
|
end
|
|
117
117
|
|
|
118
|
+
# Gracefully interrupt all child instances.
|
|
119
|
+
def interrupt
|
|
120
|
+
# We must enter the stopping state before signalling the children. Interrupting a child causes it to drain and exit, but the main run loop will respawn any child that exits while `restart: true` and the container is not stopping (see the `restart && !@stopping` gate in `#run`). Without setting this flag, an interrupted child immediately respawns, so the container never drains and `#wait` never returns.
|
|
121
|
+
#
|
|
122
|
+
# This matters most for `Hybrid` containers: a `SIGINT`/`SIGTERM` delivered to a fork is translated into a call to `#interrupt` on the inner threaded container, which typically runs with `restart: true` (the default for `async-service` managed services). If `#interrupt` did not set this flag, the inner threads would drain, exit, and respawn in a loop, so a single signal would never terminate the fork. Setting `@stopping = true` here makes `#interrupt` behave as the start of a graceful shutdown: children drain and exit, are not respawned, and the fork terminates - consistent with how `Forked` and `Threaded` containers handle a single interrupt.
|
|
123
|
+
@stopping = true
|
|
124
|
+
@group.interrupt
|
|
125
|
+
end
|
|
126
|
+
|
|
118
127
|
# Returns true if all children instances have the specified status flag set.
|
|
119
128
|
# e.g. `:ready`.
|
|
120
129
|
# This state is updated by the process readiness protocol mechanism. See {Notify::Client} for more details.
|
|
@@ -31,14 +31,15 @@ module Async
|
|
|
31
31
|
container.wait_until_ready
|
|
32
32
|
instance.ready!
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
begin
|
|
35
|
+
container.wait
|
|
36
|
+
rescue Interrupt
|
|
37
|
+
# Gracefully interrupt child threads; parent process handles escalation.
|
|
38
|
+
container.interrupt
|
|
39
|
+
retry
|
|
40
|
+
end
|
|
39
41
|
ensure
|
|
40
|
-
|
|
41
|
-
container.stop
|
|
42
|
+
container.stop(false)
|
|
42
43
|
end
|
|
43
44
|
end
|
|
44
45
|
|
data/readme.md
CHANGED
|
@@ -28,6 +28,14 @@ Please see the [project documentation](https://socketry.github.io/async-containe
|
|
|
28
28
|
|
|
29
29
|
Please see the [project releases](https://socketry.github.io/async-container/releases/index) for all releases.
|
|
30
30
|
|
|
31
|
+
### v0.35.1
|
|
32
|
+
|
|
33
|
+
- **Fixed**: `Hybrid` container now stops on interrupt instead of restarting indefinitely.
|
|
34
|
+
|
|
35
|
+
### v0.35.0
|
|
36
|
+
|
|
37
|
+
- **Fixed**: `Hybrid` now interrupts inner threaded children during graceful shutdown and force-stops remaining children on exit.
|
|
38
|
+
|
|
31
39
|
### v0.34.5
|
|
32
40
|
|
|
33
41
|
- **Fixed**: `instance.exec` with `ready: true` no longer causes premature termination. The notification pipe is now always passed to the exec'd process.
|
|
@@ -61,17 +69,6 @@ Please see the [project releases](https://socketry.github.io/async-container/rel
|
|
|
61
69
|
- Minor **breaking** changes to `Async::Container::Policy` interface.
|
|
62
70
|
- Expose `Async::Container::Statistics::Rate#window`.
|
|
63
71
|
|
|
64
|
-
### v0.31.0
|
|
65
|
-
|
|
66
|
-
- Introduce `Async::Container::Policy` for managing child lifecycle events and implementing custom failure handling strategies.
|
|
67
|
-
- Add `Async::Container::Statistics::Rate` for tracking failure and restart rates over sliding time windows.
|
|
68
|
-
- Fix restart counter to only increment when actually restarting (check `@running` flag).
|
|
69
|
-
|
|
70
|
-
### v0.30.0
|
|
71
|
-
|
|
72
|
-
- `SIGTERM` is now graceful, the same as `SIGINT`, for better compatibility with Kubernetes and systemd.
|
|
73
|
-
- `ASYNC_CONTAINER_INTERRUPT_TIMEOUT` and `ASYNC_CONTAINER_TERMINATE_TIMEOUT` are removed and replaced by `ASYNC_CONTAINER_GRACEFUL_TIMEOUT`.
|
|
74
|
-
|
|
75
72
|
## Contributing
|
|
76
73
|
|
|
77
74
|
We welcome contributions to this project.
|
|
@@ -82,6 +79,22 @@ We welcome contributions to this project.
|
|
|
82
79
|
4. Push to the branch (`git push origin my-new-feature`).
|
|
83
80
|
5. Create new Pull Request.
|
|
84
81
|
|
|
82
|
+
### Running Tests
|
|
83
|
+
|
|
84
|
+
To run the test suite:
|
|
85
|
+
|
|
86
|
+
``` shell
|
|
87
|
+
bundle exec sus
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Making Releases
|
|
91
|
+
|
|
92
|
+
To make a new release:
|
|
93
|
+
|
|
94
|
+
``` shell
|
|
95
|
+
bundle exec bake gem:release:patch # or minor or major
|
|
96
|
+
```
|
|
97
|
+
|
|
85
98
|
### Developer Certificate of Origin
|
|
86
99
|
|
|
87
100
|
In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.
|
data/releases.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
+
## v0.35.1
|
|
4
|
+
|
|
5
|
+
- **Fixed**: `Hybrid` container now stops on interrupt instead of restarting indefinitely.
|
|
6
|
+
|
|
7
|
+
## v0.35.0
|
|
8
|
+
|
|
9
|
+
- **Fixed**: `Hybrid` now interrupts inner threaded children during graceful shutdown and force-stops remaining children on exit.
|
|
10
|
+
|
|
3
11
|
## v0.34.5
|
|
4
12
|
|
|
5
13
|
- **Fixed**: `instance.exec` with `ready: true` no longer causes premature termination. The notification pipe is now always passed to the exec'd process.
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: async-container
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.35.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
113
113
|
- !ruby/object:Gem::Version
|
|
114
114
|
version: '0'
|
|
115
115
|
requirements: []
|
|
116
|
-
rubygems_version: 4.0.
|
|
116
|
+
rubygems_version: 4.0.10
|
|
117
117
|
specification_version: 4
|
|
118
118
|
summary: Abstract container-based parallelism using threads and processes where appropriate.
|
|
119
119
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|