Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error log no function clause matching during server shutdown #931

Closed
vitorquintanilha opened this issue Jul 27, 2023 · 1 comment
Closed
Labels
area:oss Related to Oban OSS closed:invalid This doens't seem right kind:bug Something isn't working

Comments

@vitorquintanilha
Copy link

vitorquintanilha commented Jul 27, 2023

Hi there! Thanks for the amazing working on Oban 🙏.

Here is a small bug report:

Environment

  • Oban Version: 2.13.2
  • PostgreSQL Version: 13.7
  • Elixir & Erlang/OTP Versions (elixir --version): 1.14.4 & 25.3.0

Current Behavior

During a shutdown of our servers, we receive the following error logs:

SIGTERM received - shutting down

GenServer {Oban.Registry, {Oban, {:plugin, Oban.Plugins.Pruner}}} terminating
** (FunctionClauseError) no function clause matching in Oban.Plugins.Pruner.handle_info/2
    (oban 2.13.2) lib/oban/plugins/pruner.ex:109: Oban.Plugins.Pruner.handle_info({:EXIT, #PID<0.1778.0>, :shutdown}, %Oban.Plugins.Pruner.State{conf: %Oban.Config{dispatch_cooldown: 5, engine: Oban.Engines.Basic, get_dynamic_repo: nil, log: false, name: Oban, node: "...", notifier: Oban.Notifiers.Postgres, peer: Oban.Peers.Postgres, plugins: [Oban.Plugins.Pruner, Oban.Plugins.Stager], prefix: "public", queues: [upload_processing: [limit: 5]], repo: UploadService.Repo, shutdown_grace_period: 15000, testing: :disabled}, name: {:via, Registry, {Oban.Registry, {Oban, {:plugin, Oban.Plugins.Pruner}}}}, timer: #Reference<0.1380755889.311951361.242224>, interval: 30000, max_age: 60, limit: 10000})
    (stdlib 4.3.1) gen_server.erl:1123: :gen_server.try_dispatch/4
    (stdlib 4.3.1) gen_server.erl:1200: :gen_server.handle_msg/6
    (stdlib 4.3.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:EXIT, #PID<0.1778.0>, :shutdown}

GenServer {Oban.Registry, {Oban, {:plugin, Oban.Plugins.Stager}}} terminating
** (FunctionClauseError) no function clause matching in Oban.Plugins.Stager.handle_info/2
    (oban 2.13.2) lib/oban/plugins/stager.ex:102: Oban.Plugins.Stager.handle_info({:EXIT, #PID<0.1778.0>, :shutdown}, %Oban.Plugins.Stager.State{conf: %Oban.Config{dispatch_cooldown: 5, engine: Oban.Engines.Basic, get_dynamic_repo: nil, log: false, name: Oban, node: "...", notifier: Oban.Notifiers.Postgres, peer: Oban.Peers.Postgres, plugins: [Oban.Plugins.Pruner, Oban.Plugins.Stager], prefix: "public", queues: [upload_processing: [limit: 5]], repo: UploadService.Repo, shutdown_grace_period: 15000, testing: :disabled}, name: {:via, Registry, {Oban.Registry, {Oban, {:plugin, Oban.Plugins.Stager}}}}, timer: #Reference<0.1380755889.311951361.242225>, limit: 5000, interval: 1000})
    (stdlib 4.3.1) gen_server.erl:1123: :gen_server.try_dispatch/4
    (stdlib 4.3.1) gen_server.erl:1200: :gen_server.handle_msg/6
    (stdlib 4.3.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:EXIT, #PID<0.1778.0>, :shutdown}

I don't think there are any direct consequences to it other than being noisy for our monitors.

Expected Behavior

During a clean shutdown, I wouldn't expect to see any errors logs.

@sorentwo sorentwo added kind:bug Something isn't working area:oss Related to Oban OSS closed:invalid This doens't seem right labels Jul 27, 2023
@sorentwo
Copy link
Member

That looks like an issue with your shutdown sequence. Something those plugins rely on, most likely your Repo, is shutting down before they do.

Be sure that Oban is toward the bottom of your supervision tree so it shuts down first. That will allow it to stop plugins and long-running jobs gracefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:oss Related to Oban OSS closed:invalid This doens't seem right kind:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants