You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stormcrawler.apache.org by "tballison (via GitHub)" <gi...@apache.org> on 2025/02/21 15:40:50 UTC

[PR] #1474 -- catch OpenSearchExceptions to prevent percolation of Runtime… [incubator-stormcrawler]

tballison opened a new pull request, #1476:
URL: https://github.com/apache/incubator-stormcrawler/pull/1476

   …Exceptions, including check-then-update race condition in creating an index.
   
   My guess is that the original intention was to catch everything from the client. However, the client can throw an OpenSearchStatusException which extends OpenSearchException which extends RuntimeException.
   
   This catches and logs problems creating indices and templates.
   
   Thank you for contributing to Apache StormCrawler.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a issue associated with this PR? Is it referenced in the commit message?
   
   - [ ] Does your PR title start with `#XXXX` where `XXXX` is the issue number you are trying to resolve? 
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically main)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [ ] Is the code properly formatted with `mvn git-code-format:format-code -Dgcf.globPattern="**/*" -Dskip.format.code=false`?
   
   ### For code changes:
   
   - [ ] Have you ensured that the full suite of tests is executed via `mvn clean verify`?
   - [ ] Have you written or updated unit tests to verify your changes?
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file?
   - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file?
   
   
   ### Note:
   Please ensure that once the PR is submitted, you check GitHub Actions for build issues and submit an update to your PR as soon as possible.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@stormcrawler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] #1474 -- catch OpenSearchExceptions to prevent percolation of Runtime… [incubator-stormcrawler]

Posted by "jnioche (via GitHub)" <gi...@apache.org>.
jnioche commented on code in PR #1476:
URL: https://github.com/apache/incubator-stormcrawler/pull/1476#discussion_r1966560109


##########
external/opensearch/src/main/java/org/apache/stormcrawler/opensearch/IndexCreation.java:
##########
@@ -100,7 +107,8 @@ private static boolean createIndex(
             final CreateIndexResponse createIndexResponse =
                     client.indices().create(createIndexRequest, RequestOptions.DEFAULT);
             return createIndexResponse.isAcknowledged();
-        } catch (IOException e) {
+        } catch (IOException | OpenSearchException e) {
+            log.warn("index not created", e);

Review Comment:
   maybe log the name of the index at the same time?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@stormcrawler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] #1474 -- catch OpenSearchExceptions to prevent percolation of Runtime… [incubator-stormcrawler]

Posted by "jnioche (via GitHub)" <gi...@apache.org>.
jnioche commented on code in PR #1476:
URL: https://github.com/apache/incubator-stormcrawler/pull/1476#discussion_r1966560088


##########
external/opensearch/src/main/java/org/apache/stormcrawler/opensearch/IndexCreation.java:
##########
@@ -78,13 +84,14 @@ private static boolean createTemplate(
             final AcknowledgedResponse createIndexResponse =
                     client.indices().putTemplate(createIndexRequest, RequestOptions.DEFAULT);
             return createIndexResponse.isAcknowledged();
-        } catch (IOException e) {
+        } catch (IOException | OpenSearchException e) {
+            log.warn("template not created", e);

Review Comment:
   maybe log the name of the template at the same time?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@stormcrawler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] #1474 -- catch OpenSearchExceptions to prevent percolation of Runtime… [incubator-stormcrawler]

Posted by "tballison (via GitHub)" <gi...@apache.org>.
tballison merged PR #1476:
URL: https://github.com/apache/incubator-stormcrawler/pull/1476


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@stormcrawler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org