Skip to content

Update async-container 0.18.3 → 0.26.0 (major)#822

Closed
depfu[bot] wants to merge 1 commit intomasterfrom
depfu/update/async-container-0.26.0
Closed

Update async-container 0.18.3 → 0.26.0 (major)#822
depfu[bot] wants to merge 1 commit intomasterfrom
depfu/update/async-container-0.26.0

Conversation

@depfu
Copy link
Copy Markdown
Contributor

@depfu depfu bot commented Aug 30, 2025

Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.

What changed?

↗️ async-container (indirect, 0.18.3 → 0.26.0) · Repo · Changelog

Release Notes

0.26.0 (from changelog)

Production Reliability Improvements

This release significantly improves container reliability by eliminating production hangs caused by unresponsive child processes.

SIGKILL Fallback Support: Containers now automatically escalate to SIGKILL when child processes ignore SIGINT and SIGTERM signals. This prevents the critical production issue where containers would hang indefinitely waiting for uncooperative processes to exit.

Hang Prevention: Individual child processes now have timeout-based hang prevention. If a process closes its notification pipe but doesn't actually exit, the container will detect this and escalate to SIGKILL after a reasonable timeout instead of hanging forever.

Improved Three-Phase Shutdown: The Group#stop() method now uses a cleaner interrupt → terminate → kill escalation sequence with configurable timeouts for each phase, giving well-behaved processes multiple opportunities to shut down gracefully while ensuring unresponsive processes are eventually terminated.

0.25.0 (from changelog)

  • Introduce async:container:notify:log:ready? task for detecting process readiness.

0.24.0 (from changelog)

  • Add support for health check failure metrics.

0.23.0 (from changelog)

Add support for NOTIFY_LOG for Kubernetes readiness probes.

You may specify a NOTIFY_LOG environment variable to enable readiness logging to a log file. This can be used for Kubernetes readiness probes, e.g.

containers:
	- name: falcon
		env:
			- name: NOTIFY_LOG
				value: "/tmp/notify.log"
		command: ["falcon", "host"]
		readinessProbe:
			exec:
				command: ["sh", "-c", "grep -q '\"ready\":true' /tmp/notify.log"]
			initialDelaySeconds: 5
			periodSeconds: 5
			failureThreshold: 12

0.21.0 (from changelog)

  • Use SIGKILL/Thread#kill when the health check fails. In some cases, SIGTERM may not be sufficient to terminate a process because the signal can be ignored or the process may be in an uninterruptible state.

0.20.1 (from changelog)

  • Fix compatibility between {ruby Async::Container::Hybrid} and the health check.
  • {ruby Async::Container::Generic#initialize} passes unused arguments through to {ruby Async::Container::Group}.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ async (indirect, 2.23.0 → 2.28.0) · Repo · Changelog

Release Notes

2.28.0 (from changelog)

  • Use Traces.current_context and Traces.with_context for better integration with OpenTelemetry.

2.27.4 (from changelog)

  • Suppress excessive warning in Async::Scheduler#async.

2.27.3 (from changelog)

  • Ensure trace attributes are strings, fixes integration with OpenTelemetry.

2.27.2 (from changelog)

  • Fix context/index.yaml schema.

2.27.1 (from changelog)

  • Updated documentation and agent context.

2.27.0 (from changelog)

  • Async::Task#stop supports an optional cause: argument (that defaults to $!), which allows you to specify the cause (exception) for stopping the task.
  • Add thread-safety agent context.

2.26.0 (from changelog)

  • Async::Notification#signal now returns true if a task was signaled, false otherwise, providing better feedback for notification operations.
  • require "async/limited_queue" is required to use Async::LimitedQueue without a deprecation warning. Async::LimitedQueue is not deprecated, but it's usage via async/queue is deprecated.
  • Async::Task#sleep is deprecated with no replacement.
  • Async::Task.yield is deprecated with no replacement.
  • Async::Scheduler#async is deprecated, use Async{}, Sync{} or Async::Task#async instead.
  • Agent context is now available, via the agent-context gem.

Async::Barrier Improvements

Async::Barrier now provides more flexible and predictable behavior for waiting on task completion:

  • Completion-order waiting: barrier.wait now processes tasks in the order they complete rather than the order they were created. This provides more predictable behavior when tasks have different execution times.
  • Block-based waiting: barrier.wait now accepts an optional block that yields each task as it completes, allowing for custom handling of individual tasks:
barrier = Async::Barrier.new

# Start several tasks
3.times do |i|
barrier.async do |task|
sleep(rand * 0.1) # Random completion time
"result_#{i}"
end
end

# Wait for all tasks, processing them as they complete
barrier.wait do |task|
result = task.wait
puts "Task completed with: #{result}"
end

  • Partial completion support: The new block-based interface allows you to wait for only the first N tasks to complete:
# Wait for only the first 3 tasks to complete
count = 0
barrier.wait do |task|
	task.wait
	count += 1
	break if count >= 3
end

This makes Async::Barrier a superset of Async::Waiter functionality, providing more flexible task coordination patterns, and therrefore, Async::Waiter is now deprecated.

Introduce Async::Queue#close

Async::Queue and Async::LimitedQueue can now be closed, which provides better resource management and error handling:

  • New close method: Both queue types now have a close method that prevents further items from being added and signals any waiting tasks.
  • Consistent error handling: All queue modification methods (push, enqueue, <<) now raise Async::Queue::ClosedError when called on a closed queue.
  • Waiting task signaling: When a queue is closed, any tasks waiting on dequeue (for regular queues) or enqueue (for limited queues) are properly signaled and can complete.
queue = Async::Queue.new

# Start a task waiting for items:
waiting_task = Async do
queue.dequeue
end

# Close the queue - this signals the waiting task
queue.close

# These will raise Async::Queue::ClosedError
queue.push(:item) # => raises ClosedError
queue.enqueue(:item) # => raises ClosedError
queue << :item # => raises ClosedError

# Dequeue returns nil when closed and empty
queue.dequeue # => nil

2.25.0 (from changelog)

  • Added support for io_select hook in the fiber scheduler, allowing non-blocking IO.select operations. This enables better integration with code that uses IO.select for multiplexing IO operations.

Use IO::Event::WorkerPool for Blocking Operations

The Async::WorkerPool implementation has been removed in favor of using IO::Event::WorkerPool directly. This change simplifies the codebase by delegating worker pool functionality to the io-event gem, which provides a more efficient and well-tested implementation.

To enable the worker pool, you can set the ASYNC_SCHEDULER_WORKER_POOL environment variable to true. This will allow the scheduler to use a worker pool for blocking operations, which can help improve performance in applications that perform a lot of CPU-bound operations (e.g. rb_nogvl).

Better handling of IO#close using fiber_interrupt

IO#close interrupts fibers that are waiting on the IO using the new fiber_interrupt hook introduced in Ruby 3.5/4.0. This means that if you close an IO while a fiber is waiting on it, the fiber will be interrupted and will raise an IOError. This is a change from previous versions of Ruby, where closing an IO would not interrupt fibers waiting on it, and would instead interrupt the entire event loop (essentially a bug).

r, w = IO.pipe

Async do
child = Async do
r.gets
end

<span class="pl-s1">r</span><span class="pl-kos">.</span><span class="pl-en">close</span> <span class="pl-c"># This will interrupt the child fiber.</span>
<span class="pl-s1">child</span><span class="pl-kos">.</span><span class="pl-en">wait</span> <span class="pl-c"># This will raise an `IOError` because the IO was closed.</span>

end

2.24.0 (from changelog)

  • Ruby v3.1 support is dropped.
  • Async::Wrapper which was previously deprecated, is now removed.

Flexible Timeouts

When {ruby Async::Scheduler#with_timeout} is invoked with a block, it can receive a {ruby Async::Timeout} instance. This allows you to adjust or cancel the timeout while the block is executing. This is useful for long-running tasks that may need to adjust their timeout based on external factors.

Async do
Async::Scheduler.with_timeout(5) do |timeout|
# Do some work that may take a while...

	<span class="pl-k">if</span> <span class="pl-en">some_condition</span>
		<span class="pl-s1">timeout</span><span class="pl-kos">.</span><span class="pl-en">cancel!</span> <span class="pl-c"># Cancel the timeout</span>
	<span class="pl-k">else</span>
		<span class="pl-c"># Add 10 seconds to the current timeout:</span>
		<span class="pl-s1">timeout</span><span class="pl-kos">.</span><span class="pl-en">adjust</span><span class="pl-kos">(</span><span class="pl-c1">10</span><span class="pl-kos">)</span>
	&lt;span class="pl-c"&gt;# Reduce the timeout by 10 seconds:&lt;/span&gt;
	&lt;span class="pl-s1"&gt;timeout&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;adjust&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;-&lt;span class="pl-c1"&gt;10&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;
	
	&lt;span class="pl-c"&gt;# Set the timeout to 10 seconds from now:&lt;/span&gt;
	&lt;span class="pl-s1"&gt;timeout&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;duration&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-c1"&gt;10&lt;/span&gt;
	
	&lt;span class="pl-c"&gt;# Increase the current duration:&lt;/span&gt;
	&lt;span class="pl-s1"&gt;timeout&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;duration&lt;/span&gt; += &lt;span class="pl-c1"&gt;10&lt;/span&gt;
&lt;span class="pl-k"&gt;end&lt;/span&gt;

<span class="pl-k">end</span>

end

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ console (indirect, 1.29.3 → 1.33.0) · Repo · Changelog

Release Notes

1.32.0 (from changelog)

  • Add fiber_id to serialized output records to help identify which fiber logged the message.
  • Ractor support appears broken in older Ruby versions, so we now require Ruby 3.4 or later for Ractor compatibility, if you need Ractor support.

1.31.0 (from changelog)

Ractor compatibility.

The console library now works correctly with Ruby's Ractor concurrency model. Previously, attempting to use console logging within Ractors would fail with errors about non-shareable objects. This has been fixed by ensuring the default configuration is properly frozen.

# This now works without errors:
ractor = Ractor.new do
require 'console'
Console.info('Hello from Ractor!')
'Ractor completed successfully'
end

result = ractor.take
puts result # => 'Ractor completed successfully'

The fix is minimal and maintains full backward compatibility while enabling safe parallel logging across multiple Ractors.

Symbol log level compatibility.

Previously, returning symbols from custom log_level methods in configuration files would cause runtime errors like "comparison of Integer with :debug failed". This has been fixed to properly convert symbols to their corresponding integer values.

# config/console.rb - This now works correctly:
def log_level(env = ENV)
	:debug  # Automatically converted to Console::Logger::LEVELS[:debug]
end

While this fix maintains backward compatibility, the recommended approach is still to use integer values directly:

# config/console.rb - Recommended approach:
def log_level(env = ENV)
	Console::Logger::LEVELS[:debug]  # Returns 0
end

Improved output format selection for cron jobs and email contexts.

When MAILTO environment variable is set (typically in cron jobs), the console library now prefers human-readable terminal output instead of JSON serialized output, even when the output stream is not a TTY. This ensures that cron job output sent via email is formatted in a readable way for administrators.

# Previously in cron jobs (non-TTY), this would output JSON:

# {"time":"2025-06-07T10:30:00Z","severity":"info","subject":"CronJob","message":["Task completed"]}

# Now with MAILTO set, it outputs human-readable format:
# 0.1s info: CronJob
# | Task completed

This change is conservative and only affects environments where MAILTO is explicitly set, ensuring compatibility with existing deployments.

1.30.0 (from changelog)

Introduce Console::Config for fine grained configuration.

Introduced a new explicit configuration interface via config/console.rb to enhance logging setup in complex applications. This update gives the application code an opportunity to load files if required and control aspects such as log level, output, and more. Users can override default behaviors (e.g., make_output, make_logger, and log_level) for improved customization.

# config/console.rb
def log_level(env = ENV)
# Set a custom log level, e.g., force debug mode:
:debug
end

def make_logger(output = $stderr, env = ENV, **options)
# Custom logger configuration with verbose output:
options[:verbose] = true

 <span class="pl-v">Logger</span><span class="pl-kos">.</span><span class="pl-en">new</span><span class="pl-kos">(</span><span class="pl-s1">output</span><span class="pl-kos">,</span> **<span class="pl-s1">options</span><span class="pl-kos">)</span>

end

This approach provides a standard way to hook into the log setup process, allowing tailored adjustments for reliable and customizable logging behavior.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ fiber-storage (indirect, 1.0.0 → 1.0.1) · Repo

Sorry, we couldn't find anything useful about this release.

↗️ io-event (indirect, 1.9.0 → 1.12.1) · Repo · Changelog

Release Notes

1.11.2 (from changelog)

  • Fix Windows build.

1.11.1 (from changelog)

  • Fix read_nonblock when using the URing selector, which was not handling zero-length reads correctly. This allows reading available data without blocking.

1.11.0 (from changelog)

Introduce IO::Event::WorkerPool for off-loading blocking operations.

The {ruby IO::Event::WorkerPool} provides a mechanism for executing blocking operations on separate OS threads while properly integrating with Ruby's fiber scheduler and GVL (Global VM Lock) management. This enables true parallelism for CPU-intensive or blocking operations that would otherwise block the event loop.

# Fiber scheduler integration via blocking_operation_wait hook
class MyScheduler
def initialize
@worker_pool = IO::Event::WorkerPool.new
end

def blocking_operation_wait(operation)
@worker_pool.call(operation)
end
end

# Usage with automatic offloading
Fiber.set_scheduler(MyScheduler.new)
# Automatically offload rb_nogvl(..., RB_NOGVL_OFFLOAD_SAFE) to a background thread:
result = some_blocking_operation()

The implementation uses one or more background threads and a list of pending blocking operations. Those operations either execute through to completion or may be cancelled, which executes the "unblock function" provided to rb_nogvl.

1.10.2 (from changelog)

  • Improved consistency of handling closed IO when invoking #select.

1.10.0 (from changelog)

  • IO::Event::Profiler is moved to dedicated gem: fiber-profiler.
  • Perform runtime checks for native selectors to ensure they are supported in the current environment. While compile-time checks determine availability, restrictions like seccomp and SELinux may still prevent them from working.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ json (indirect, 2.10.2 → 2.13.2) · Repo · Changelog

Release Notes

2.13.2

What's Changed

  • Improve duplicate key warning and errors to include the key name and point to the right caller.

Full Changelog: v2.13.1...v2.13.2

2.13.1

What's Changed

  • Fix support for older compilers without __builtin_cpu_supports.

Full Changelog: v2.13.0...v2.13.1

2.13.0

What's Changed

  • Add new allow_duplicate_key parsing options. By default a warning is now emitted when a duplicated key is encountered.
    In json 3.0 an error will be raised.
  • Optimize parsing further using SIMD to scan strings.

Full Changelog: v2.12.2...v2.13.0

2.12.2

  • Fix compiler optimization level.

Full Changelog: v2.12.1...v2.12.2

2.12.1

What's Changed

  • Fix a potential crash in large negative floating point number generation.
  • Fix for JSON.pretty_generate to use passed state object's generate instead of state class as the required parameters aren't available.

Full Changelog: v2.12.0...v2.12.1

2.12.0 (from changelog)

  • Improve floating point generation to not use scientific notation as much.
  • Include line and column in parser errors. Both in the message and as exception attributes.
  • Handle non-string hash keys with broken to_s implementations.
  • JSON.generate now uses SSE2 (x86) or NEON (arm64) instructions when available to escape strings.

2.11.3 (from changelog)

  • Fix a regression in JSON.pretty_generate that could cause indentation to be off once some #to_json has been called.

2.11.2 (from changelog)

  • Add back JSON::PRETTY_STATE_PROTOTYPE. This constant was private API but is used by popular gems like multi_json. It now emits a deprecation warning.

2.11.1

What's Changed

  • Add back JSON.restore, JSON.unparse, JSON.fast_unparse and JSON.pretty_unparse.
    These were deprecated 16 years ago, but never emited warnings, only undocumented, so are
    still used by a few gems.

Full Changelog: v2.11.0...v2.11.1

2.11.0

What's Changed

  • Optimize Integer generation to be ~1.8x faster.
  • Optimize Float generation to be ~10x faster.
  • Fix JSON.load proc argument to substitute the parsed object with the return value.
    This better match Marshal.load behavior.
  • Deprecate JSON.fast_generate (it's not any faster, so pointless).
  • Deprecate JSON.load_default_options.
  • Deprecate JSON.unsafe_load_default_options.
  • Deprecate JSON.dump_default_options.
  • Deprecate Kernel#j
  • Deprecate Kernel#jj
  • Remove outdated JSON.iconv.
  • Remove Class#json_creatable? monkey patch.
  • Remove deprecated JSON.restore method.
  • Remove deprecated JSON.unparse method.
  • Remove deprecated JSON.fast_unparse method.
  • Remove deprecated JSON.pretty_unparse method.
  • Remove deprecated JSON::UnparserError constant.
  • Remove outdated JSON::MissingUnicodeSupport constant.

Full Changelog: v2.10.2...v2.11.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ metrics (indirect, 0.12.1 → 0.14.0) · Repo

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ traces (indirect, 0.15.2 → 0.18.1) · Repo · Changelog

Release Notes

0.18.1 (from changelog)

  • Don't call prepare in traces/provider.rb. It can cause circular loading warnings.

0.18.0 (from changelog)

  • W3C Baggage Support - Full support for W3C Baggage specification for application-specific context propagation.

New Context Propagation Interfaces

Traces#trace_context and Traces.trace_context are insufficient for efficient inter-process tracing when using OpenTelemetry. That is because OpenTelemetry has it's own "Context" concept with arbitrary key-value storage (of which the current span is one such key/value pair). Unfortunately, OpenTelemetry requires those values to be propagated "inter-process" while ignores them for "intra-process" tracing.

Therefore, in order to propagate this context, we introduce 4 new methods:

  • Traces.current_context - Capture the current trace context for local propagation between execution contexts (threads, fibers).
  • Traces.with_context(context) - Execute code within a specific trace context, with automatic restoration when used with blocks.
  • Traces.inject(headers = nil, context = nil) - Inject W3C Trace Context headers into a headers hash for distributed propagation.
  • Traces.extract(headers) - Extract trace context from W3C Trace Context headers.

The default implementation is built on top of Traces.trace_context, however these methods can be replaced by the backend. In that case, the context object is opaque, in other words it is library-specific, and you should not assume it is an instance of Traces::Context.

0.17.0 (from changelog)

  • Remove support for resource: keyword argument with no direct replacement – use an attribute instead.

0.16.0 (from changelog)

  • Introduce traces:provider:list command to list all available trace providers.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)
Go to the Depfu Dashboard to see the state of your dependencies and to customize how Depfu works.

@depfu
Copy link
Copy Markdown
Contributor Author

depfu bot commented Oct 14, 2025

Closed in favor of #830.

@depfu depfu bot closed this Oct 14, 2025
@depfu depfu bot deleted the depfu/update/async-container-0.26.0 branch October 14, 2025 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants