Skip to content

Commit

Permalink
Disable busy limits
Browse files Browse the repository at this point in the history
  • Loading branch information
akash-akya committed Sep 25, 2024
1 parent 34b8897 commit 9fcb065
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions lib/ex_cmd/process/proto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ defmodule ExCmd.Process.Proto do
bin = <<tag::unsigned-integer-8, bin::binary>>

try do
true = Port.command(port, bin)
# even though we are using `:nosuspend` we should never receive `false`
# since we are disabling busy_limits while opening the `port`
true = Port.command(port, bin, [:nosuspend])
:ok
rescue
# this is needed because the port might have already been closed
Expand All @@ -152,7 +154,18 @@ defmodule ExCmd.Process.Proto do

defp start_odu_port(odu_path, cmd_with_args, opts) do
args = build_odu_params(opts) ++ ["--" | cmd_with_args]
options = [:use_stdio, :exit_status, :binary, :hide, {:packet, 4}, args: args]

options = [
:use_stdio,
:exit_status,
:binary,
:hide,
{:packet, 4},
args: args,
busy_limits_port: :disabled,
busy_limits_msgq: :disabled
]

Port.open({:spawn_executable, odu_path}, options)
end

Expand Down

0 comments on commit 9fcb065

Please sign in to comment.