Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Some actions that application developers should consider taking when upgrading f
#### Added

* `hot_cell/health_operations` defines `health.echo` and `health.reopen`, the round trips an application calls to prove it can use a cell's work socket. A cell serves them only if it requires the file.
* The `hotcell.describe` response now includes `server_version`. This value is the version of the `hotcell-server` gem that the cell runs. You do not need a shell in the container to find it. (#21)

#### Improved

Expand Down
6 changes: 5 additions & 1 deletion hotcell-server/lib/hot_cell/control.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ def answer(line, running:, queued:)

# Static, and called once per registered cell at app boot. It is the cheapest way to catch a client
# whose own timeout is below what this cell may take, and it is what `bin/hotcell describe` reads.
#
# `v` is the wire format and changes only when the format does; `server_version` says which release of
# hotcell-server is answering.
def describe
{ v: PROTOCOL_VERSION, operations: Registry.names, groups: groups, **@configuration.to_h }
{ v: PROTOCOL_VERSION, server_version: Server::VERSION, operations: Registry.names, groups: groups,
**@configuration.to_h }
end

private
Expand Down
6 changes: 6 additions & 0 deletions hotcell-server/test/control_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ def test_describe_reports_what_the_cell_carries_and_how_long_it_may_take
end
end

def test_describe_reports_which_build_of_the_cell_is_running
TestCell.boot do |cell|
assert_equal HotCell::Server::VERSION, assert_ok(cell.control("hotcell.describe")).result[:server_version]
end
end

# Counts lag responses, and the wait is the assertion rather than a workaround. The worker writes the
# response and the supervisor increments the counter when it later reads that worker's idle report — two
# processes — so a caller can be holding its answer before the count exists. Anything reading these for
Expand Down
Loading