hotcell-core 0.3.1 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 214b910102e639e8d5e5d7f5f145046c53d7fe45146a661054097731303d12db
4
- data.tar.gz: 02db6536062e350ae67eefae22b50d83d8aa629b24487fdb01339e97308c045e
3
+ metadata.gz: 95511ee58391c053b92d27a8319662886a03d89c5ad77678e15035172bef73b2
4
+ data.tar.gz: 8669f785992e111145536ca8e3cb3454d7ae382afd7379d184c1b91c311540c8
5
5
  SHA512:
6
- metadata.gz: e4be2dd15734d9b3958ee98408866b9302f0a854a6ad16d652954e42f7f986a53286034b2af38eef9f09dc2ba2cc348d20b9707cf07c0e473a74a5742c2f9076
7
- data.tar.gz: 6251a4224a51c24ce0b8bc245335973e2ccc33670594e41bb374242e8d70a46d0226247225415d61945ec1c2220db0ce6bd837779c9477e22b5529582a43f112
6
+ metadata.gz: 2b71c00024fce34aa32f04a9781a5c6d6ba55afe5d6c834098fa932eb81ca8ef3ed4511242ee12d04d0fb2a8c85362969342e1d9f9a2dbe1d378116d9b4bccf1
7
+ data.tar.gz: 51df2f9b07d76029f19b3bd786be7fe6101cb09ca33dda558ce7e8beea819e2617ddef65473254ed1b891c9dd30d1fb94072d5a376be6471aecf4771f7d3b52a
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HotCell
4
- VERSION = "0.3.1"
4
+ VERSION = "0.4.1"
5
5
  end
@@ -22,27 +22,21 @@ module HotCell
22
22
  JSON.generate object
23
23
  end
24
24
 
25
- # Keys are deep-symbolized here rather than in an operation, so an operation never has to know
26
- # whether to reach for payload[:format] or payload["format"], and a nested hash can be splatted
27
- # straight into a library's keyword arguments. Only keys: a Symbol value would not survive the
28
- # round trip, which the JSON-native rule already forbids.
25
+ # Keys are symbolized so operations read payload[:format] and can splat a nested hash into keyword
26
+ # arguments. Values are not: a Symbol would not survive the round trip, which the JSON-native rule
27
+ # already forbids.
29
28
  #
30
- # JSON.parse only. Never JSON.load, and never create_additions, both of which instantiate
31
- # arbitrary classes named by a json_class key in the document.
29
+ # One rescue for the whole JSON layer. Naming what JSON.parse raises has been wrong twice: a report
30
+ # that was not an object raised TypeError past a rescue for JSON::ParserError, and a key holding
31
+ # invalid UTF-8 raised EncodingError past both. The supervisor parses worker reports inside its
32
+ # deadline loop with nothing above it rescuing, so each miss denies service to every request in the
33
+ # cell.
32
34
  #
33
- # Every way this can fail becomes one named failure, and the catch-all is the point rather than
34
- # laziness. Callers used to name what JSON.parse raises, and naming it has now been wrong twice: a
35
- # report that was not an object raised TypeError past a rescue for JSON::ParserError, and a key
36
- # holding bytes that are not valid UTF-8 raises EncodingError past both. The supervisor reads worker
37
- # reports through here inside the loop that enforces every request's deadline, and nothing above it
38
- # rescues anything, so each miss is a one-line denial of service against every request in the cell.
39
- #
40
- # The body is a single JSON.parse call, so this is scoped to "the JSON layer failed" and cannot
41
- # swallow a bug in our own code. NoMemoryError is deliberately not caught: it is not a StandardError,
42
- # and a document large enough to raise it is the worker's own memory verdict rather than a bad line.
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
37
+ # bad line.
43
38
  def parse(json)
44
- JSON.parse json, symbolize_names: true, max_nesting: MAX_NESTING, allow_nan: false,
45
- create_additions: false
39
+ JSON.parse json, symbolize_names: true, max_nesting: MAX_NESTING, allow_nan: false
46
40
  rescue StandardError => error
47
41
  raise MessageError, "#{error.class}: #{Failure.sanitize(error.message)}"
48
42
  end
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.3.1
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
@@ -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/v0.3.1/hotcell-core
47
- changelog_uri: https://github.com/basecamp/hotcell/blob/v0.3.1/CHANGELOG.md
46
+ source_code_uri: https://github.com/basecamp/hotcell/tree/v0.4.1/hotcell-core
47
+ changelog_uri: https://github.com/basecamp/hotcell/blob/v0.4.1/CHANGELOG.md
48
48
  bug_tracker_uri: https://github.com/basecamp/hotcell/issues
49
49
  rubygems_mfa_required: 'true'
50
50
  rdoc_options: []