hotcell-core 1.1.0 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cee7ec2d2cf66191fe36c65ee799ebead567515b4d8815fd194ee2f4e21b2e68
4
- data.tar.gz: efbf59f1ee0b4579d8e7d98a65200eed5bc6b5546782a403216784fb5f8075cd
3
+ metadata.gz: 18422ba38ab889459be6c0b8527f42de192c5a6454dee63a23ac3298cc1610ec
4
+ data.tar.gz: 68cbf455e50633d16d0f620ce95af4c7315e42106a654440fddfb1136291255f
5
5
  SHA512:
6
- metadata.gz: 4ab338d0b9c68b834e1e70021013bb8a7f1f3335c1c7a49a5e5e59ce44d0009cd5ddc72be724439c29902e940c6924ba58c45b24770d920656e9ec8e232c6b5e
7
- data.tar.gz: 283063e9416cbdb6ea1dd9ba103adc727ce3a478fe9f5f03918e9bbc62537d8f2f63167dbefa3a4999cfa0841d9ad4ed5e6f279700b0a6179947f6239ec5b2a6
6
+ metadata.gz: fe2050dbea7ceb1a89393498fefe0f14f50510d8623decfc2b73221afc9c6b519f4aea95927433f2ba44262b72d19df043c071fd61dc94aafb25fd6dda53a454
7
+ data.tar.gz: d3e737603771d2d89cc5f94f01ffb73145533319817fecced75fe642e4a8dcc3011239374cfee1b15049ed02374e66057266079a4f674799a6be9f91f4834661
data/README.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # hotcell-core
2
2
 
3
- Part of [HotCell](https://github.com/basecamp/hotcell). See the repository README.
3
+ Part of [Hot Cell](https://github.com/basecamp/hotcell). See the repository README.
@@ -82,10 +82,10 @@ module HotCell
82
82
  #
83
83
  # So the supervisor never infers either of them from a signal. They are decided in the worker, which is
84
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
85
+ # write of its own returns EFBIG. See Worker#disarm_file_size_signal for why the `fsize` failure has
86
86
  # to be earned that way rather than read off a wait status.
87
87
  #
88
- # That is a narrower guarantee than "a permanent verdict cannot be forged", and the difference matters.
88
+ # That is a narrower guarantee than "a permanent failure cannot be forged", and the difference matters.
89
89
  # It removes the supervisor as an instrument: a sibling's signal no longer travels through a wait status
90
90
  # into someone else's blob. It does nothing about a cell that has been compromised outright and answers
91
91
  # a connection itself — `from_wire` believes a `permanent` boolean off the wire, and a worker that stole
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HotCell
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.0"
5
5
  end
@@ -117,7 +117,7 @@ module HotCell
117
117
  # Copies the bytes onto the worker's own scratch on the first call and returns the filename. This is the
118
118
  # fallback, for an operation that genuinely needs a real file. Prefer `fd_path`, which reads the
119
119
  # descriptor in place: staging is a write, so RLIMIT_FSIZE bounds it, and an input larger than the
120
- # operation's file_size dies here as a permanent `fsize` verdict — a ceiling Rails does not have. The
120
+ # operation's file_size dies here as a permanent `fsize` failure — a ceiling Rails does not have. The
121
121
  # Active Storage operations all read `fd_path` for exactly that reason; nothing should reach for `path`
122
122
  # without a specific need for a distinct on-disk copy.
123
123
  #
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HotCell
4
- # What this gem raises when a call is wrong, as distinct from a cell's verdict on a conversion.
4
+ # What this gem raises when a call is wrong, as distinct from a cell's failure.
5
5
  #
6
6
  # These must be raised outside the client's transport rescue. An application injects its own
7
- # exception classes for a cell's verdicts, and if one of those descends from IOError then a bad call
7
+ # exception classes for a cell's failures, and if one of those descends from IOError then a bad call
8
8
  # swallowed by the transport rescue comes back as a socket failure and gets retried forever.
9
9
  class Error < StandardError; end
10
10
 
@@ -24,7 +24,7 @@ module HotCell
24
24
  # cannot hold its limits and a client that cannot classify a failure are both worse discovered in traffic.
25
25
  class ConfigurationError < Error; end
26
26
 
27
- # A peer that stopped mid-message. Distinct from a cell answering `timeout`, which is a verdict: this is
27
+ # A peer that stopped mid-message. Distinct from a cell answering `timeout`, which is a failure: this is
28
28
  # the caller's own deadline passing with the response incomplete.
29
29
  class ReadTimeout < Error; end
30
30
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HotCell
4
- # A cell's verdict on a request that did not succeed.
4
+ # A cell's answer to a request that did not succeed.
5
5
  #
6
6
  # The message is untrusted and it outlives the request. It comes out of a worker that has just parsed
7
7
  # a hostile file, and Vips::Error#message routinely contains the input filename. Applications store
@@ -59,9 +59,10 @@ module HotCell
59
59
  class << self
60
60
  # Builds from either a message String or an Exception. An Exception has to become two wire fields, and
61
61
  # that rule was written out at three call sites across two gems — the worker, the supervisor's control
62
- # answer, and the client's transport.
62
+ # answer, and the client's transport. `::Exception` because hotcell-client defines Failure::Exception,
63
+ # which a bare `Exception` here would name.
63
64
  def for(code, detail, cause: nil)
64
- if detail.is_a?(Exception)
65
+ if detail.is_a?(::Exception)
65
66
  new code: code, cause: cause, error_class: detail.class.name, message: detail.message
66
67
  else
67
68
  new code: code, cause: cause, message: detail
@@ -70,7 +71,7 @@ module HotCell
70
71
 
71
72
  # A code this client has never heard of is not permanent. An old client will meet a code added
72
73
  # later, and the harm of the two mistakes is not symmetrical: retrying something permanent costs
73
- # some work, while writing down a verdict that was temporary is irreversible.
74
+ # some work, while writing down a failure that was temporary is irreversible.
74
75
  # A `permanent` that is present but not a boolean is derived rather than believed. Truthiness would make
75
76
  # any non-nil value permanent, and permanent is the answer that cannot be taken back — so a garbled
76
77
  # field must not be able to say it.
@@ -33,7 +33,7 @@ module HotCell
33
33
  # cell.
34
34
  #
35
35
  # The body is one JSON.parse call, so the rescue cannot hide a bug of our own. NoMemoryError is not
36
- # a StandardError and stays uncaught: a document that large is the worker's memory verdict, not a
36
+ # a StandardError and stays uncaught: a document that large is the worker's `memory` failure, not a
37
37
  # bad line.
38
38
  def parse(json)
39
39
  JSON.parse json, symbolize_names: true, max_nesting: MAX_NESTING, allow_nan: false
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: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
@@ -10,7 +10,7 @@ cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: |
13
- The wire protocol between an application and a HotCell container: the request and response format,
13
+ The wire protocol between an application and a Hot Cell container: the request and response format,
14
14
  file descriptor passing over SCM_RIGHTS, payload validation, and the error taxonomy. Both
15
15
  hotcell-client and hotcell-server depend on it. Install one of those rather than this.
16
16
  email:
@@ -43,8 +43,8 @@ licenses:
43
43
  - MIT
44
44
  metadata:
45
45
  homepage_uri: https://github.com/basecamp/hotcell
46
- source_code_uri: https://github.com/basecamp/hotcell/tree/v1.1.0/hotcell-core
47
- changelog_uri: https://github.com/basecamp/hotcell/blob/v1.1.0/CHANGELOG.md
46
+ source_code_uri: https://github.com/basecamp/hotcell/tree/v1.2.0/hotcell-core
47
+ changelog_uri: https://github.com/basecamp/hotcell/blob/v1.2.0/CHANGELOG.md
48
48
  documentation_uri: https://basecamp.github.io/hotcell/
49
49
  bug_tracker_uri: https://github.com/basecamp/hotcell/issues
50
50
  rubygems_mfa_required: 'true'
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  requirements: []
65
- rubygems_version: 4.0.16
65
+ rubygems_version: 4.0.6
66
66
  specification_version: 4
67
- summary: The wire protocol shared by both sides of a HotCell.
67
+ summary: The wire protocol shared by both sides of a Hot Cell.
68
68
  test_files: []