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

Unified Diff: appengine/swarming/server/task_scheduler.py

Issue 2012843003: Remove use of search API; effectively remove support to search for task by name. (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: . Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/swarming/server/task_result_test.py ('k') | appengine/swarming/server/task_scheduler_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/server/task_scheduler.py
diff --git a/appengine/swarming/server/task_scheduler.py b/appengine/swarming/server/task_scheduler.py
index 6c17a65440ea71913450714271dd7d7d66370eca..5465d95202c13b8b8d25178ad9bee00c78c1e3c3 100644
--- a/appengine/swarming/server/task_scheduler.py
+++ b/appengine/swarming/server/task_scheduler.py
@@ -14,7 +14,6 @@ import math
import random
from google.appengine.api import datastore_errors
-from google.appengine.api import search
from google.appengine.ext import ndb
from google.appengine.runtime import apiproxy_errors
@@ -411,21 +410,6 @@ def schedule_request(request):
task = task_to_run.new_task_to_run(request)
result_summary = task_result.new_result_summary(request)
- # Do not specify a doc_id, as they are guaranteed to be monotonically
- # increasing and searches are done in reverse order, which fits exactly the
- # created_ts ordering. This is useful because DateField is precise to the date
- # (!) and NumberField is signed 32 bits so the best it could do with EPOCH is
- # second resolution up to year 2038.
- index = search.Index(name='requests')
- packed = task_pack.pack_result_summary_key(result_summary.key)
- doc = search.Document(
- fields=[
- search.TextField(name='name', value=request.name),
- search.AtomField(name='id', value=packed),
- ])
- # Even if it fails here, we're still fine, as the task is not "alive" yet.
- search_future = index.put_async([doc])
-
now = utils.utcnow()
if dupe_future:
@@ -483,12 +467,6 @@ def schedule_request(request):
if parent_task_keys:
futures.append(datastore_utils.transaction_async(run_parent))
- try:
- search_future.get_result()
- except search.Error:
- # Do not abort the task, for now search is best effort.
- logging.exception('Put failed')
-
for future in futures:
# Check for failures, it would raise in this case, aborting the call.
future.get_result()
« no previous file with comments | « appengine/swarming/server/task_result_test.py ('k') | appengine/swarming/server/task_scheduler_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698