jenkins-bot has submitted this change and it was merged.

Change subject: Handle es 2.x document missing exceptions
......................................................................


Handle es 2.x document missing exceptions

ES 2.x made error responses more structured. This is good because it
means we can more explicitly test for errors, but it broke the existing
code. Will need to re-run this weeks popularity score export after
deploying this patch.

Change-Id: Ia8f469a28c1b657c4cc44f27bf4f8edabfa4c685
---
M oozie/transfer_to_es/transferToES.py
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  DCausse: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/oozie/transfer_to_es/transferToES.py 
b/oozie/transfer_to_es/transferToES.py
index 73b3656..17f6476 100644
--- a/oozie/transfer_to_es/transferToES.py
+++ b/oozie/transfer_to_es/transferToES.py
@@ -99,8 +99,11 @@
             if 'status' not in item['update']:
                 continue
             if item['update']['status'] != 200:
-                if 'error' in item['update'] and item['update']['error'][0:24] 
== 'DocumentMissingException':
-                    continue
+                try:
+                    if item['update']['error']['type'] == 
'document_missing_exception':
+                        continue
+                except KeyError:
+                    pass
                 failedDocumentCounter.add(1)
 
     def sendDocumentsToES(documents):

-- 
To view, visit https://gerrit.wikimedia.org/r/292955
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8f469a28c1b657c4cc44f27bf4f8edabfa4c685
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/discovery/analytics
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: DCausse <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to