0

我让 Jenkins 在我们所有的应用程序机器上运行部署脚本。最近,我的一半构建没有完成并且在尝试运行相同的东西时一直挂起。最后的输出如下所示:

 ** [app@app1 :: stdout] Generating Configuration to /var/www/app/releases/20130509192657/config/production.sphinx.conf
 ** [app@app2 :: stdout] Generating Configuration to /var/www/app/releases/20130509192657/config/production.sphinx.conf
 ** [app@app3 :: stdout] Generating Configuration to /var/www/app/releases/20130509192657/config/production.sphinx.conf
 ** [app@app4 :: stdout] Generating Configuration to /var/www/app/releases/20130509192657/config/production.sphinx.conf
 ** [app@app6 :: stdout] Generating Configuration to /var/www/app/releases/20130509192657/config/production.sphinx.conf
 ** [app@app7 :: stdout] Generating Configuration to /var/www/app/releases/20130509192657/config/production.sphinx.conf

app5 总是似乎有这个问题的机器,它在尝试运行时出现:

/usr/local/bin/ruby /usr/local/bin/bundle exec rake db:migrate ts:conf

生产运行 ruby​​ 1.9.3p194,由于遗留原因,我们仍在运行 ThinkingSphinx v. 0.9.8。我们也在运行 Rails 3.2.13 和 ThinkingSphinx 2.0.7。

在挂起过程上运行 strace 会告诉我:

...
29802 select(4, [3], NULL, NULL, NULL <unfinished ...>
29790 restart_syscall(<... resuming interrupted call ...>) = -1 ETIMEDOUT (Connection timed out)
29790 futex(0x64a88e8, FUTEX_WAKE_PRIVATE, 1) = 0
29790 write(4, "!", 1 <unfinished ...>
29802 <... select resumed> )            = 1 (in [3])
29790 <... write resumed> )             = 1
29802 read(3,  <unfinished ...>
29790 futex(0x1d47f64, FUTEX_WAIT_PRIVATE, 3, NULL <unfinished ...>
29802 <... read resumed> "!", 1024)     = 1
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
29802 select(4, [3], NULL, NULL, {0, 100000}) = 0 (Timeout)
...

有没有人见过这个?在 sysops 方面没有太多背景,我应该采取什么具体方法来解决这个问题?

4

1 回答 1

0

如果 adb:migrate正在锁定,那么您可能有一个活动的或挂起的(可能是僵尸)进程锁定了迁移中引用的数据库表(或其他资源)。我最近遇到过这种情况,另一位工程师运行的数据修复脚本崩溃了(在我尝试部署的一周前),但没有退出 - 持有一个阻止更改表的开放事务。我们的解决方法是简单地终止卡住的进程,然后迁移正常工作。

在不了解您的系统架构的情况下,很难准确了解冲突资源可能是什么。您的 rdbms 工具包可能允许您查看托管在服务器上的 db 并查看打开的连接在做什么。

于 2013-05-10T06:48:38.270 回答