Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: appengine/findit/crash/crash_pipeline.py

Issue 2378133004: [Findit] Rerun if the regression range is different. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import copy 5 import copy
6 import json 6 import json
7 import logging 7 import logging
8 8
9 from google.appengine.api import app_identity 9 from google.appengine.api import app_identity
10 from google.appengine.ext import ndb 10 from google.appengine.ext import ndb
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 with pipeline.After(run_analysis): 101 with pipeline.After(run_analysis):
102 yield PublishResultPipeline(crash_identifiers, client_id) 102 yield PublishResultPipeline(crash_identifiers, client_id)
103 103
104 104
105 @ndb.transactional 105 @ndb.transactional
106 def _NeedsNewAnalysis( 106 def _NeedsNewAnalysis(
107 crash_identifiers, chrome_version, signature, client_id, 107 crash_identifiers, chrome_version, signature, client_id,
108 platform, stack_trace, customized_data): 108 platform, stack_trace, customized_data):
109 analysis = findit_for_client.GetAnalysisForClient(crash_identifiers, 109 analysis = findit_for_client.GetAnalysisForClient(crash_identifiers,
110 client_id) 110 client_id)
111 if analysis and not analysis.failed: 111 regression_range = findit_for_client.GetRegressionRange(client_id,
112 # A new analysis is not needed if last one didn't complete or succeeded. 112 customized_data)
113 # TODO(http://crbug.com/600535): re-analyze if stack trace or regression 113 if (analysis and (regression_range == analysis.regression_range) and
stgao 2016/10/07 20:29:35 Should we also test regression_range is not empty?
Sharu Jiang 2016/10/07 22:05:03 For those with empty regressions, we can still fin
stgao 2016/10/07 22:26:04 What if both regression range are empty? Do we rea
114 # range changed. 114 not analysis.failed):
wrengr 2016/10/07 17:32:06 Does it make sense to check analysis.failed after
Sharu Jiang 2016/10/07 22:05:03 Done.
115 logging.info('The analysis of %s has already been done.', 115 logging.info('The analysis of %s has already been done.',
116 repr(crash_identifiers)) 116 repr(crash_identifiers))
117 return False 117 return False
118 118
119 # Create analysis for findit to run if this is not a rerun. 119 # Create analysis for findit to run if this is not a rerun.
120 if not analysis: 120 if not analysis:
121 analysis = findit_for_client.CreateAnalysisForClient(crash_identifiers, 121 analysis = findit_for_client.CreateAnalysisForClient(crash_identifiers,
122 client_id) 122 client_id)
123 123
124 findit_for_client.ResetAnalysis(analysis, chrome_version, signature, 124 findit_for_client.ResetAnalysis(analysis, chrome_version, signature,
125 client_id, platform, stack_trace, 125 client_id, platform, stack_trace,
126 customized_data) 126 customized_data, regression_range)
127 return True 127 return True
128 128
129 129
130 def ScheduleNewAnalysisForCrash( 130 def ScheduleNewAnalysisForCrash(
131 crash_identifiers, chrome_version, signature, client_id, 131 crash_identifiers, chrome_version, signature, client_id,
132 platform, stack_trace, customized_data, 132 platform, stack_trace, customized_data,
133 queue_name=constants.DEFAULT_QUEUE): 133 queue_name=constants.DEFAULT_QUEUE):
134 """Schedules an analysis.""" 134 """Schedules an analysis."""
135 # Check policy and tune arguments if needed. 135 # Check policy and tune arguments if needed.
136 pass_policy, updated_analysis_args = findit_for_client.CheckPolicyForClient( 136 pass_policy, updated_analysis_args = findit_for_client.CheckPolicyForClient(
137 crash_identifiers, chrome_version, signature, 137 crash_identifiers, chrome_version, signature,
138 client_id, platform, stack_trace, 138 client_id, platform, stack_trace,
139 customized_data) 139 customized_data)
140 140
141 if not pass_policy: 141 if not pass_policy:
142 return False 142 return False
143 143
144 if _NeedsNewAnalysis(*updated_analysis_args): 144 if _NeedsNewAnalysis(*updated_analysis_args):
145 analysis_pipeline = CrashWrapperPipeline(crash_identifiers, client_id) 145 analysis_pipeline = CrashWrapperPipeline(crash_identifiers, client_id)
146 # Attribute defined outside __init__ - pylint: disable=W0201 146 # Attribute defined outside __init__ - pylint: disable=W0201
147 analysis_pipeline.target = appengine_util.GetTargetNameForModule( 147 analysis_pipeline.target = appengine_util.GetTargetNameForModule(
148 constants.CRASH_BACKEND[client_id]) 148 constants.CRASH_BACKEND[client_id])
149 analysis_pipeline.start(queue_name=queue_name) 149 analysis_pipeline.start(queue_name=queue_name)
150 logging.info('New %s analysis is scheduled for %s', client_id, 150 logging.info('New %s analysis is scheduled for %s', client_id,
151 repr(crash_identifiers)) 151 repr(crash_identifiers))
152 return True 152 return True
153 153
154 return False 154 return False
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/crash/findit_for_chromecrash.py » ('j') | appengine/findit/crash/findit_for_client.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698