プロジェクト

全般

プロフィール

Defect #1310

未完了

Hanging build results are showed on issue page when server restarts.

Ivan Samygin さんが約10年前に追加. 約10年前に更新.

ステータス:
新規(New)
優先度:
通常(Normal)
担当者:
-
カテゴリ:
Hudson Plugin
対象バージョン:
開始日:
2014/02/19
期日:
進捗率:

0%

予定工数:

説明

具体的な再現方法
What steps will reproduce the problem?

  1. Install redmine 2.4.2
  2. Configure redmine project repository.
  3. Install and configure Redime Hudson plugin version 2.1.2
  4. Set autofetch built details.
  5. Restart redmine during hudson build is in progress, just before build is finished (I restarted apache).
  6. Wait a while - to be ensured that autofetch job has been launched.

期待する結果と実際の結果
What is the expected output? What do you see instead?

I've got 'hanging' build results on issue page with text
"builded by <JobName> #228 at about 44 years ago".

And that's what I see in the database:

mysql> select * from hudson_builds;
+-----+---------------+---------+---------------------+----------+-------+-----------+--------+
| id  | hudson_job_id | result  | finished_at         | building | error | caused_by | number |
+-----+---------------+---------+---------------------+----------+-------+-----------+--------+
| 645 |             5 | SUCCESS | 2014-02-18 13:03:43 | false    |       |         1 |    204 |
| 646 |             7 | SUCCESS | 2014-02-18 13:03:43 | false    |       |         1 |    181 |
| 647 |            23 |         | 1970-01-01 03:00:00 |          |       |         1 |    228 |
| 648 |             9 | SUCCESS | 2014-02-18 18:17:00 | false    |       |         1 |    246 |
| 649 |             2 | SUCCESS | 2014-02-18 18:11:19 | false    |       |         1 |    357 |

下記コマンドの実行結果を教えてください。
Please give us a result of following command.

% ruby script/about
sh: darcs: not found
sh: cvs: not found
sh: bzr: not found
sh: git: not found
Environment:
  Redmine version                2.4.2.stable
  Ruby version                   2.1.0-p0 (2013-12-25) [i686-linux]
  Rails version                  3.2.16
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.6.12
  Mercurial                      1.7.5
  Filesystem
Redmine plugins:
  clipboard_image_paste          1.8
  menu_link                      1.0.0
  redmine_code_review            0.6.3
  redmine_contacts               3.2.13-light
  redmine_create_wiki_page       0.1
  redmine_free_mind              1.1.1
  redmine_hudson                 2.1.2
  redmine_issue_checklist        2.0.5
  redmine_issue_templates        0.0.5
  redmine_issues_macros          0.0.1
  redmine_knowledgebase          3.0.0
  redmine_sidebar_toc            0.0.1
  redmine_tags                   2.1.0
  redmine_wiki_toc               0.0.4

Please provide any additional information below.

I fixed this on my system adding one more condition to HudsonJob.do_fetch? method:

diff -r -c -w /tmp/redmine_hudson/app/models/hudson_job.rb /usr/share/redmine/plugins/redmine_hudson/app/models/hudson_job.rb
*** /tmp/redmine_hudson/app/models/hudson_job.rb    2013-09-23 14:50:56.000000000 +0400
--- /usr/share/redmine/plugins/redmine_hudson/app/models/hudson_job.rb    2014-02-19 12:14:56.508001577 +0400
***************
*** 230,235 ****
--- 230,236 ----
      latest_build = get_build(self.latest_build_number)
      return true if latest_build.is_a? HudsonNoBuild
      return true if latest_build.building?
+     return true if !latest_build.finished_at || latest_build.finished_at == Time.at(0)

      return false
    end

Ivan Samygin さんが約10年前に更新

With patch provided above there is an issue with changeset duplication: changeset is added every fetch operation.

This fix it all...

他の形式にエクスポート: Atom PDF