elixir - 混合版本“start_iex”显示错误,而“start”不显示
问题描述
背景
我正在通过mix release
. 但是,即使我可以手动运行该应用程序,启动它时也会出现一些错误。
mix release
我正在尝试使用mix release
. 此命令工作正常,它会在_build/prod/rel/my_app/bin/my_app
. 我可以使用该命令运行这个可执行文件,start
并且一切运行良好。
但是,如果不是start
我使用start_iex
我首先得到一个错误,然后应用程序正常运行:
$ _build/prod/rel/my_app/bin/my_app start_iex
Erlang/OTP 22 [erts-10.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
*** ERROR: Shell process terminated! (^G to start new job) ***
Erlang/OTP 22 [erts-10.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
my_app
是一个伞式应用程序。这是mix.exs
伞应用程序的内容:
defmodule MyApp.MixProject do
use Mix.Project
def project do
[
apps_path: "apps",
version: "0.1.0",
start_permanent: Mix.env() == :prod,
deps: deps(),
elixir: "~> 1.10",
releases: releases()
]
end
defp deps, do: []
defp releases, do:
[
my_app: [
applications: [
api: :permanent,
core: :permanent,
storage: :permanent
]
]
]
end
问题
- 为什么我在使用时会出错,
start_iex
而在使用时却没有start
? - 为什么
start_iex
错误后工作?
解决方案
当您启用了 shell 历史记录时,这是一个竞争条件。这里有一个公开的报告。
因为 disk_log 是在用户进程之后启动的,所以在关闭时可能会出现竞争条件,其中 disk_log 将在 group 之前终止,这将无法记录。
此外,如果 disk_log 在 shell 启动之前终止,那么整个 shell 将无法启动,这将递归地触发另一个 shell,直到系统最终关闭。这可以用这个命令重现:
$ erl -kernel shell_history true -s init restart
推荐阅读
- python - 如何正确使用括号?
- wso2-am - wso2 api manager 3.2.0如何在Oracle RAC环境中配置oracle数据库
- asp.net - Oracle ManagedDataAccess 4.122.1.0 可以连接到 Oracle server 19c 吗?
- excel - 如何使用 Excel VBA 将当前工作表保存为 PDF 和 Outlook 电子邮件?
- html - 如何在纯 CSS 中创建拆分背景颜色布局
- scope - 如何在 vb.net 中使用 largescope 声明局部变量
- garbage-collection - 为什么打开的连接或未关闭的资源不能被垃圾回收?
- git - GitHub Rest API 类似 git rev-list 命令
- netsuite - 尝试在 item_fulfillment 上删除 Line 时出错
- css - npm 与编译过程 sass cammand line