5534: When a pipeline has long running jobs with hundreds of thousands of log lines...
authorRadhika Chippada <radhika@curoverse.com>
Tue, 24 Mar 2015 13:49:38 +0000 (09:49 -0400)
committerRadhika Chippada <radhika@curoverse.com>
Tue, 24 Mar 2015 13:49:38 +0000 (09:49 -0400)
fetching all those lines. Limiting the number of log lines retrieved helped resolve this issue. Using limit size of 2000.
I was able to see log when I limited to 10000 log lines as well, but it took much longer wait time and I felt a quicker
response might provide a better user experience and hence using 2000 log lines as the limit. Thus the most recent 2000
log lines are fetched, followed by newer log lines from event log if the job is still running.

apps/workbench/app/helpers/jobs_helper.rb

index 06c3d0d4206a554fd84539fb9275054ce55166e6..24033137b0f349f9bf0fd7cbc17bc2b717c82fef 100644 (file)
@@ -3,7 +3,7 @@ module JobsHelper
     results = []
 
     log_history = Log.where(event_type: 'stderr',
-                            object_uuid: job_uuids).order('id DESC')
+                            object_uuid: job_uuids).limit(2000).order('id DESC')
     if !log_history.results.empty?
       reversed_results = log_history.results.reverse
       reversed_results.each do |entry|