2024-12-08 17:23:05 by Takahiro Kambe | Files touched by this commit (3) | |
Log message: devel/ruby-async: update to 2.21.1 2.19.0 (2024-11-08) Async::Scheduler Debugging Occasionally on issues, I encounter people asking for help and I need more information. Pressing Ctrl-C to exit a hung program is common, but it usually doesn't provide enough information to diagnose the problem. Setting the CONSOLE_LEVEL=debug environment variable will now print additional information about the scheduler when you interrupt it, including a backtrace of the current tasks. > CONSOLE_LEVEL=debug bundle exec ruby ./test.rb ^C 0.0s debug: Async::Reactor [oid=0x974] [ec=0x988] [pid=9116] [2024-11-08 \ 14:12:03 +1300] | Scheduler interrupted: Interrupt | #<Async::Reactor:0x0000000000000974 1 children (running)> | #<Async::Task:0x000000000000099c \ /Users/samuel/Developer/socketry/async/lib/async/scheduler.rb:185:in `transfer' \ (running)> | → \ /Users/samuel/Developer/socketry/async/lib/async/scheduler.rb:185:in `transfer' | \ /Users/samuel/Developer/socketry/async/lib/async/scheduler.rb:185:in `block' | \ /Users/samuel/Developer/socketry/async/lib/async/scheduler.rb:207:in \ `kernel_sleep' | /Users/samuel/Developer/socketry/async/test.rb:7:in `sleep' | /Users/samuel/Developer/socketry/async/test.rb:7:in `sleepy' | /Users/samuel/Developer/socketry/async/test.rb:12:in `block \ in <top (required)>' | \ /Users/samuel/Developer/socketry/async/lib/async/task.rb:197:in `block in run' | \ /Users/samuel/Developer/socketry/async/lib/async/task.rb:420:in `block in \ schedule' /Users/samuel/Developer/socketry/async/lib/async/scheduler.rb:317:in `select': \ Interrupt ... (backtrace continues) ... This gives better visibility into what the scheduler is doing, and should help diagnose issues. Console Shims The async gem depends on console gem, because my goal was to have good logging by default without thinking about it too much. However, some users prefer to avoid using the console gem for logging, so I've added an experimental set of shims which should allow you to bypass the console gem entirely. require 'async/console' require 'async' Async{raise "Boom"} Will now use Kernel#warn to print the task failure warning: #<Async::Task:0x00000000000012d4 \ /home/samuel/Developer/socketry/async/lib/async/task.rb:104:in `backtrace' \ (running)> Task may have ended with unhandled exception. (irb):4:in `block in <top (required)>': Boom (RuntimeError) from /home/samuel/Developer/socketry/async/lib/async/task.rb:197:in `block in run' from /home/samuel/Developer/socketry/async/lib/async/task.rb:420:in `block in \ schedule' 2.20.0 (2024-11-10) Traces and Metrics Providers Async now has traces and metrics providers for various core classes. This allows you to emit traces and metrics to a suitable backend (including DataDog, New Relic, OpenTelemetry, etc.) for monitoring and debugging purposes. To take advantage of this feature, you will need to introduce your own config/traces.rb and config/metrics.rb. Async's own repository includes these files for testing purposes, you could copy them into your own project and modify them as needed. 2.21.0 (2024-11-21) (No release note, not released?) 2.21.1 (2024-11-27) Worker Pool Ruby 3.4 will feature a new fiber scheduler hook, blocking_operation_wait which allows the scheduler to redirect the work given to rb_nogvl to a worker pool. The Async scheduler optionally supports this feature using a worker pool, by \ using the following environment variable: ASYNC_SCHEDULER_DEFAULT_WORKER_POOL=true This will cause the scheduler to use a worker pool for general blocking operations, rather than blocking the event loop. It should be noted that this isn't a net win, as the overhead of using a worker pool can be significant compared to the rb_nogvl work. As such, it is recommended to benchmark your application with and without the worker pool to determine if it is beneficial. |
2024-11-06 15:03:37 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: devel/ruby-async: update to 2.18.0 2.18.0 (2024-10-29) * Add support for Sync(annotation:), so that you can annotate the block with a description of what it does, even if it doesn't create a new task. |
2024-09-18 16:59:00 by Takahiro Kambe | Files touched by this commit (3) | |
Log message: devel/ruby-async: update to 2.17.0 2.15.0 (2024-08-04) * Allow transient tasks to exit completely. (#336) 2.15.1 (2024-08-07) * Allow transient tasks to exit gracefully. (#337) 2.15.2 (2024-08-07) * Transient tasks should only be stopped once. (#338) 2.15.3 (2024-08-08) * Ensure that defer_stop resets state. (#339) 2.16.0 (2024-08-23) Better Handling of Async and Sync in Nested Fibers Interleaving bare fibers within Async and Sync blocks should not cause problems, but it presents a number of issues in the current implementation. Tracking the parent-child relationship between tasks, when they are interleaved with bare fibers, is difficult. The current implementation assumes that if there is no parent task, then it should create a new reactor. This is not always the case, as the parent task might not be visible due to nested Fibers. As a result, Async will create a new reactor, trying to stop the existing one, causing major internal consistency issues. I encountered this issue when trying to use Async within a streaming response in Rails. The protocol-rack uses a normal fiber to wrap streaming responses, and if you try to use Async within it, it will create a new reactor, causing the server to lock up. Ideally, Async and Sync helpers should work when any Fiber.scheduler is defined. Right now, it's unrealistic to expect Async::Task to work in any scheduler, but at the very least, the following should work: reactor = Async::Reactor.new # internally calls Fiber.set_scheduler # This should run in the above reactor, rather than creating a new one. Async do puts "Hello World" end In order to do this, bare Async and Sync blocks should use Fiber.scheduler as a parent if possible. See #340 for more details. 2.16.1 (2024-08-26) * Add timeout to timeout error message. 2.17.0 (2024-09-05) * Introduce Async::Queue#push and Async::Queue#pop for compatibility with ::Queue. |
2024-07-20 17:20:07 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: xdevel/ruby-async: update to 2.14.2 2.14.1 (2024-07-15) * Minor updates to compatibility guide. * Add initial debugging guide. * Restore error logging. (#331) * Remove unused gem dependency. * Use direct instance variable for async_task. 2.14.2 (2024-07-17) * Fix failure logs and add explicit tests. |
2024-07-15 17:29:32 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: devel/ruby-async: update to 2.14.1 2.14.1 (2024-07-15) * Minor updates to compatibility guide. * Add initial debugging guide. * Restore error logging. (#331) * Use direct instance variable for async_task. |
2024-07-14 17:45:52 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: devel/ruby-async: update to 2.14.0 2.14.0 (2024-07-14) * Opt-in to task failures using $DEBUG only. * Update external tests - drop async-io. |
2024-07-14 09:21:45 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: devel/ruby-async: update to 2.13.0 2.13.0 (2024-07-12) * Update logo. * Waiter#async: pass options to parent (#327) * Minor documentation updates. * Allow queue to be used for task finished. (#276) |
2024-06-30 18:06:01 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: devel/ruby-async: update to 2.12.1 2.12.1 (2024-06-23) * Docs: correct ruby version requirement * Docs: various typo fixes * Fix idle load computation. (#323) * Propagate interrupts when exiting event loop. (#322) |
2024-06-08 17:40:38 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: devel/ruby-async: update to 2.12.0 2.12.0 (2024-06-04) * Add dining philosopher's example. * Prefer IO::Event::Timers. (#316) * Add benchmark timers dependencies. |
2024-05-05 18:41:28 by Takahiro Kambe | Files touched by this commit (2) | |
Log message: devel/ruby-async: update to 2.11.0 2.10.2 (2024-04-15) What's Changed * Update readme.md - fixing a typo by @peychinov in #313 * Add source_code_uri to published gemspec. New Contributors * @peychinov made their first contribution in #313 Contributors * @peychinov 2.11.0 (2024-05-04) What's Changed * Update dependency on console gem and modernize usage. by @ioquatix in #315 Contributors * @ioquatix |