You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by "phet (via GitHub)" <gi...@apache.org> on 2023/12/15 18:07:45 UTC

[PR] [GOBBLIN-1977] Log when `PasswordManager` fails to load any master password [gobblin]

phet opened a new pull request, #3849:
URL: https://github.com/apache/gobblin/pull/3849

   Dear Gobblin maintainers,
   
   Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
   
   
   ### JIRA
   - [ ] My PR addresses the following [Gobblin JIRA](https://issues.apache.org/jira/browse/GOBBLIN/) issues and references them in the PR title. For example, "[GOBBLIN-XXX] My Gobblin PR"
       - https://issues.apache.org/jira/browse/GOBBLIN-1977
   
   
   ### Description
   - [ ] Here are some details about my PR, including screenshots (if applicable):
   
   The `PasswordManager` silently continues on when the configured master password key path does not exist in the FS.  this makes debugging exceptionally difficult.  Instead, it should log such a warning, upon finding that situation.
   
   ### Tests
   - [ ] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   
   existing tests, as this change concerns logging only
   
   ### Commits
   - [ ] My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
       1. Subject is separated from body by a blank line
       2. Subject is limited to 50 characters
       3. Subject does not end with a period
       4. Subject uses the imperative mood ("add", not "adding")
       5. Body wraps at 72 characters
       6. Body explains "what" and "why", not "how"
   
   


-- 
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@gobblin.apache.org

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


Re: [PR] [GOBBLIN-1977] Log when `PasswordManager` fails to load any master password [gobblin]

Posted by "arjun4084346 (via GitHub)" <gi...@apache.org>.
arjun4084346 merged PR #3849:
URL: https://github.com/apache/gobblin/pull/3849


-- 
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@gobblin.apache.org

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


Re: [PR] [GOBBLIN-1977] Log when `PasswordManager` fails to load any master password [gobblin]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3849:
URL: https://github.com/apache/gobblin/pull/3849#issuecomment-4186819197

   ## [Codecov](https://app.codecov.io/gh/apache/gobblin/pull/3849?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `20.00000%` with `8 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 47.59%. Comparing base ([`81910bf`](https://app.codecov.io/gh/apache/gobblin/commit/81910bf15c111945bf7c0bd65711b61416994189?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`2cf84df`](https://app.codecov.io/gh/apache/gobblin/commit/2cf84dfc3730922d048358274ed6105965d082d2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 292 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/gobblin/pull/3849?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...a/org/apache/gobblin/password/PasswordManager.java](https://app.codecov.io/gh/apache/gobblin/pull/3849?src=pr&el=tree&filepath=gobblin-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fgobblin%2Fpassword%2FPasswordManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Z29iYmxpbi1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dvYmJsaW4vcGFzc3dvcmQvUGFzc3dvcmRNYW5hZ2VyLmphdmE=) | 0.00% | [8 Missing :warning: ](https://app.codecov.io/gh/apache/gobblin/pull/3849?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3849      +/-   ##
   ============================================
   - Coverage     47.61%   47.59%   -0.02%     
   - Complexity    11064    11066       +2     
   ============================================
     Files          2159     2159              
     Lines         85455    85460       +5     
     Branches       9494     9495       +1     
   ============================================
   - Hits          40686    40678       -8     
   - Misses        41067    41081      +14     
   + Partials       3702     3701       -1     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/gobblin/pull/3849?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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@gobblin.apache.org

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


Re: [PR] [GOBBLIN-1977] Log when `PasswordManager` fails to load any master password [gobblin]

Posted by "phet (via GitHub)" <gi...@apache.org>.
phet commented on code in PR #3849:
URL: https://github.com/apache/gobblin/pull/3849#discussion_r1428325135


##########
gobblin-api/src/main/java/org/apache/gobblin/password/PasswordManager.java:
##########
@@ -124,18 +125,23 @@ private List<TextEncryptor> getEncryptors(CachedInstanceKey cacheKey) {
         suffix = "." + String.valueOf(i);
       } catch (FileNotFoundException fnf) {
         // It is ok for password files not being present
-        LOG.warn("Master password file " + currentMasterPasswordFile + " not found.");
+        LOG.warn("Master password file '" + currentMasterPasswordFile + "' not found.");
       } catch (IOException ioe) {
         exception = ioe;
-        LOG.warn("Master password could not be read from file " + currentMasterPasswordFile);
+        LOG.warn("Master password file could not be read from '" + currentMasterPasswordFile + "'");
       } catch (Exception e) {
-        LOG.warn("Encryptor could not be instantiated.");
+        LOG.warn("Encryptor could not be instantiated using file '" + currentMasterPasswordFile + "'.", e);
       }
     } while (i++ < numOfEncryptionKeys);
 
     // Throw exception if could not read any existing password file
-    if (encryptors.size() < 1 && exception != null) {
-      throw new RuntimeException("Master Password could not be read from any master password file.", exception);
+    if (encryptors.size() < 1) {
+      if (exception != null) {
+        throw new RuntimeException("Master password could not be read from any master password file.", exception);
+      } else {
+        // TODO: determine whether to always throw whenever no encryptors, despite `exception == null`!  (for now, at least give notice by logging)

Review Comment:
   I wavered on this, but ultimately decided not to pursue, as it would NOT be backwards-compatible semantics and I'm unsure whether any of these situations are essentially harmless with users happy to continue w/o disruption



-- 
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@gobblin.apache.org

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


Re: [PR] [GOBBLIN-1977] Log when `PasswordManager` fails to load any master password [gobblin]

Posted by "phet (via GitHub)" <gi...@apache.org>.
phet commented on code in PR #3849:
URL: https://github.com/apache/gobblin/pull/3849#discussion_r1428322518


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java:
##########
@@ -720,6 +720,8 @@ private void cancelDagNode(DagNode<JobExecutionPlan> dagNodeToCancel) throws Exe
         String serializedFuture = DagManagerUtils.getSpecProducer(dagNodeToCancel).serializeAddSpecResponse(future);
         props.put(ConfigurationKeys.SPEC_PRODUCER_SERIALIZED_FUTURE, serializedFuture);
         sendCancellationEvent(dagNodeToCancel.getValue());
+      } else {
+        log.warn("No Job future when canceling DAG node (hence, not sending cancellation event) - {}", dagNodeToCancel.getValue().getJobSpec().getUri());

Review Comment:
   not strictly related... just sprinkling in better logging concerning  a question I was recently pondering during another investigation



-- 
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@gobblin.apache.org

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