hotcell-core 0.1.0 → 0.2.0
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
- data/lib/hot_cell/codes.rb +12 -0
- data/lib/hot_cell/core/version.rb +1 -1
- data/lib/hot_cell/failure.rb +8 -0
- metadata +6 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e60aebb6474f67f6a35f01d9fe1e3a686c422a073e11ebf785af0816ade80e79
|
|
4
|
+
data.tar.gz: eb13e25de57e23ff35d57fe100926cd64c11ecad18af96104dd3864d2246411b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c0373bb9b2831d65e5fce1b02c7cb0ede24eed5a3d64144d905abbd93d72a7dcbf3d46250acb24caf195e1e1f9e0a530fa07ef2845c1ccba2118aed4f4e1aa2
|
|
7
|
+
data.tar.gz: a087aedd5855c87b413c53085e23d9d579a59176bc9453d1e07e4712592d1c1405f8939d42c6123ae3fa5bcf9b50ad3d0112353d3adba359a7814d55a0e0b10f
|
data/lib/hot_cell/codes.rb
CHANGED
|
@@ -79,6 +79,18 @@ module HotCell
|
|
|
79
79
|
# from somewhere it cannot see: a cgroup OOM kill chosen on aggregate pressure across concurrent workers,
|
|
80
80
|
# or one worker signalling another — they share a uid, and nothing stops that. Attributing either to the
|
|
81
81
|
# input this worker happened to be holding condemns a file for something it did not do.
|
|
82
|
+
#
|
|
83
|
+
# So the supervisor never infers either of them from a signal. They are decided in the worker, which is
|
|
84
|
+
# the process that holds the request: `memory` when it catches NoMemoryError itself, and `fsize` when a
|
|
85
|
+
# write of its own returns EFBIG. See Worker#disarm_file_size_signal for why the file-size verdict has
|
|
86
|
+
# to be earned that way rather than read off a wait status.
|
|
87
|
+
#
|
|
88
|
+
# That is a narrower guarantee than "a permanent verdict cannot be forged", and the difference matters.
|
|
89
|
+
# It removes the supervisor as an instrument: a sibling's signal no longer travels through a wait status
|
|
90
|
+
# into someone else's blob. It does nothing about a cell that has been compromised outright and answers
|
|
91
|
+
# a connection itself — `from_wire` believes a `permanent` boolean off the wire, and a worker that stole
|
|
92
|
+
# `work.sock` writes whatever it likes. That is the socket-theft residual `docs/DESIGN.md` records, and
|
|
93
|
+
# it is not closed here.
|
|
82
94
|
PERMANENT_BY_CAUSE = {
|
|
83
95
|
FSIZE => true,
|
|
84
96
|
MEMORY => true,
|
data/lib/hot_cell/failure.rb
CHANGED
|
@@ -76,6 +76,14 @@ module HotCell
|
|
|
76
76
|
error_class: wire[:class], message: wire[:message]
|
|
77
77
|
end
|
|
78
78
|
|
|
79
|
+
# For a message that is about to be written as one line of a log. `sanitize` leaves CR and LF alone,
|
|
80
|
+
# which is right for a message an application stores or re-raises, but a peer that puts a newline in
|
|
81
|
+
# one writes a second log line of its own — formatted and indented like the real ones. Escape them,
|
|
82
|
+
# and the rest of the control characters with them.
|
|
83
|
+
def one_line(text)
|
|
84
|
+
sanitize(text)&.gsub(/[[:cntrl:]]/) { |character| character.dump[1..-2] }
|
|
85
|
+
end
|
|
86
|
+
|
|
79
87
|
def sanitize(message)
|
|
80
88
|
return nil if message.nil?
|
|
81
89
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hotcell-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mike Dalessio
|
|
@@ -10,12 +10,9 @@ cert_chain: []
|
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies: []
|
|
12
12
|
description: |
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
This gem holds what both sides must agree on: the request and response format, SCM_RIGHTS
|
|
17
|
-
marshalling, descriptor access-mode verification, payload validation, and the error taxonomy.
|
|
18
|
-
It performs no I/O of its own and loads no media library.
|
|
13
|
+
The wire protocol between an application and a HotCell container: the request and response format,
|
|
14
|
+
file descriptor passing over SCM_RIGHTS, payload validation, and the error taxonomy. Both
|
|
15
|
+
hotcell-client and hotcell-server depend on it. Install one of those rather than this.
|
|
19
16
|
email:
|
|
20
17
|
- mike@37signals.com
|
|
21
18
|
executables: []
|
|
@@ -46,8 +43,8 @@ licenses:
|
|
|
46
43
|
- MIT
|
|
47
44
|
metadata:
|
|
48
45
|
homepage_uri: https://github.com/basecamp/hotcell
|
|
49
|
-
source_code_uri: https://github.com/basecamp/hotcell/tree/v0.
|
|
50
|
-
changelog_uri: https://github.com/basecamp/hotcell/blob/v0.
|
|
46
|
+
source_code_uri: https://github.com/basecamp/hotcell/tree/v0.2.0/hotcell-core
|
|
47
|
+
changelog_uri: https://github.com/basecamp/hotcell/blob/v0.2.0/CHANGELOG.md
|
|
51
48
|
bug_tracker_uri: https://github.com/basecamp/hotcell/issues
|
|
52
49
|
rubygems_mfa_required: 'true'
|
|
53
50
|
rdoc_options: []
|