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

Job の finished runs 表示での Ajax error #710

Open
noda50 opened this issue Jun 14, 2020 · 6 comments
Open

Job の finished runs 表示での Ajax error #710

noda50 opened this issue Jun 14, 2020 · 6 comments

Comments

@noda50
Copy link
Contributor

noda50 commented Jun 14, 2020

Simulator を新たに作ったり、大量の job を submit したりした後にその Simulator を消したり、などを繰り返していると、以下のエラーが生じるように見える。

まず、"Jobs" の画面の "Finished Runs" のタブ表示で、以下のポップアップが表示。

localhost:3005 の内容
DataTables warning: table id=finished_runs_list - Ajax error. For more information about this error, please see http://datatables.net/tn/7

ブラウザの developper console で確認すると、以下のエラーが出ている。

application-a50bb5a0…14766d7ce2.js:10255 GET http://localhost:3005/runs/_jobs_table.json?run_status%5B%5D=finished&run_s…rt=0&length=100&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1592113842790 500 (Internal Server Error)

ここから先は、どう追っていいか、わからず。

なお、"Finished Runs" において、ソートのキーを、"updated_at" 以外にすると、上記のエラーは生じない。

@noda50
Copy link
Contributor Author

noda50 commented Jun 14, 2020

いろいろ見ていたら、以下のような情報があった。
関係あるか不明ですが。

Mongo::Error::OperationFailure in RunsController#_jobs_table
Executor error during find command :: caused by :: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit. (96) (on 127.0.0.1:27017, modern retry, attempt 1) (on 127.0.0.1:27017, modern retry, attempt 1)

Extracted source (around line #39):

      a = []
      runs_lists.each do |run|    <<<<<
        tmp = []
        attr = OACIS_ACCESS_LEVEL==0 ? {align: "center", disabled: "disabled"} : {align: "center"}
        tmp << @view.check_box_tag("checkbox[run]", run.id, false, attr)

(上記の <<<<< は、ハイライト部分)

Application Trace
app/datatables/runs_list_datatable.rb:39:in data' app/datatables/runs_list_datatable.rb:17:in as_json'
app/controllers/runs_controller.rb:27:in `_jobs_table'

@noda50
Copy link
Contributor Author

noda50 commented Jun 14, 2020

show entry 数を減らす(25などにする)と、エラーがなくなるように見える。
50くらいだと、エラーが起きる場合がある。

@yohm
Copy link
Member

yohm commented Jun 14, 2020

エラーメッセージを読む限り、メモリを過剰に消費しているようです。
ちなみに、Runのresultのフィールドに大きなオブジェクトが入っているというようなことはありますか?
もしそうなら表示に必要なフィールドだけに対してクエリをかけることによってバグを回避できるかもしれないなと考えています。

@noda50
Copy link
Contributor Author

noda50 commented Jun 14, 2020

たしかに、result (_output.json の中身) が結構大きい事例でそうなっている。(最近、そういうものをよく流しているので)

@yohm
Copy link
Member

yohm commented Jun 15, 2020

すでにresultの部分は除外するようにクエリを作っていました😥

  def runs_lists
    @runs.order_by(sort_column_direction).without(:result).skip(page).limit(per_page)
  end

このテーブルではupdated_atのソートを行いたいですよね。updated_atにindexを張れば解決するかもしれません。お手数ですが app/models/submittable.rbに一行追加して、oacisを再起動して試してもらえませんか?

@@ -35,6 +35,7 @@ module Submittable
     # indexes
     base.send(:index, { status: 1, submitted_to_id: 1 }, { name: "#{base.to_s.downcase}_status_submitted_to_index" })
     base.send(:index, { status: 1, created_at: -1 }, { name: "#{base.to_s.downcase}_status_updated_at_index" })
+    base.send(:index, { updated_at: -1 }, { name: "#{base.to_s.downcase}_updated_at_index" })

@yohm
Copy link
Member

yohm commented Jul 11, 2020

@noda50 こちらどうでしょうか?一行追加するだけなので少し試してもらえませんか?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants