{"record":{"id":"d5f1b8d06dc35568","repo":"socketry/falcon","slug":"async-container-supervisor-is-replaced-by-async","errorCode":null,"errorMessage":"Async::Container::Supervisor is replaced by Async::Service::Supervisor, please update your service definition.","messagePattern":"Async::Container::Supervisor is replaced by Async::Service::Supervisor, please update your service definition\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/falcon/service/server.rb","lineNumber":109,"sourceCode":"\t\t\t\t\t\t\tserver = run(instance, evaluator, listener)\n\t\t\t\t\t\t\tinstance.name = format_title(evaluator, server)\n\t\t\t\t\t\t\temit_running(instance, clock)\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tinstance.ready!\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\t# Run the service logic.\n\t\t\t#\n\t\t\t# @parameter instance [Object] The container instance.\n\t\t\t# @parameter evaluator [Environment::Evaluator] The environment evaluator.\n\t\t\t# @parameter listener [Falcon::Listener] The listener used by this worker.\n\t\t\t# @returns [Falcon::Server] The server instance.\n\t\t\tdef run(instance, evaluator, listener = @listener)\n\t\t\t\tif evaluator.respond_to?(:make_supervised_worker)\n\t\t\t\t\tConsole.warn(self, \"Async::Container::Supervisor is replaced by Async::Service::Supervisor, please update your service definition.\")\n\t\t\t\t\t\n\t\t\t\t\tevaluator.make_supervised_worker(instance).run\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tserver = evaluator.make_server(listener.endpoint)\n\t\t\t\t\n\t\t\t\tAsync do |task|\n\t\t\t\t\tserver.run\n\t\t\t\t\t\n\t\t\t\t\ttask.children&.each(&:wait)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tserver\n\t\t\tend\n\t\t\t\n\t\t\t# Format the process title with server statistics.\n\t\t\t#\n\t\t\t# @parameter evaluator [Environment::Evaluator] The environment evaluator.","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/socketry/falcon/blob/5107b0713fd78dbe8b08ee123391b1f4bcffdf12/lib/falcon/service/server.rb#L91-L127","documentation":"When a server worker starts, Falcon::Service::Server#run checks whether the environment evaluator still defines make_supervised_worker — the worker hook from the Async::Container::Supervisor era (lib/falcon/service/server.rb:107-112). If it does, Falcon warns that Async::Container::Supervisor is replaced by Async::Service::Supervisor, then invokes the legacy hook anyway for backward compatibility before building the server with make_server. The current preparation hook is prepare_worker! (which delegates to prepare!) from the async-service stack.","triggerScenarios":"Starting a Falcon host with a custom service/environment definition that still defines make_supervised_worker(instance) returning an object responding to run — e.g. an environment written for older falcon that started an Async::Container::Supervisor inside each worker.","commonSituations":"Upgrading falcon/async-service while keeping an old config/falcon.rb or copied service definition; in-house supervised-worker setups (process restart policies, reload hooks) built on async-container; stale examples or documentation.","solutions":["Remove make_supervised_worker from the environment and implement prepare_worker!(instance, listener) (typically delegating to prepare!) for custom worker setup","Move supervision to Async::Service::Supervisor in the services definition and align the Gemfile on the async-service stack","Until migrated, the warning is cosmetic — falcon still runs the legacy hook, so behaviour is unchanged"],"exampleFix":"# before: legacy hook, warns on every worker start\nclass MyAppEnvironment\n  def make_supervised_worker(instance)\n    Async::Container::Supervisor.new(instance).tap(&:run)\n  end\nend\n\n# after: Async::Service based preparation\nclass MyAppEnvironment\n  include Falcon::Environment::Server # provides prepare_worker! -> prepare!\n\n  def prepare_worker!(instance, listener)\n    prepare!(instance) # Async::Service::Supervisor handles supervision\n  end\nend","handlingStrategy":"validation","validationCode":"# Preflight: refuse to deploy while the legacy supervisor hook is defined.\nif environment.evaluator.respond_to?(:make_supervised_worker)\n  abort 'Legacy Async::Container::Supervisor hook present; migrate to Async::Service (prepare_worker! / prepare!)'\nend","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After upgrading falcon/async-service, grep environments and config/falcon.rb for make_supervised_worker and remove it","Implement prepare_worker!/prepare! for custom worker preparation instead of supervisor hooks","Watch Console output during supervised starts — the warning fires once per worker"],"tags":["falcon","async-service","async-container","deprecation","supervisor","ruby"],"backgroundTag":"deprecated-api-usage","analyzedSha":"5107b0713fd78dbe8b08ee123391b1f4bcffdf12","analyzedAt":"2026-08-23T14:31:56.885Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}