SNOW-3053365: Fix NPE when HOME directory cache is not available#2534
Merged
sfc-gh-dheyman merged 3 commits intoMar 10, 2026
Conversation
048e70a to
5111f64
Compare
5111f64 to
e7b047e
Compare
sfc-gh-pfus
reviewed
Mar 5, 2026
e7b047e to
c158cf5
Compare
sfc-gh-pfus
reviewed
Mar 5, 2026
sfc-gh-pfus
approved these changes
Mar 5, 2026
sfc-gh-rkowalski
approved these changes
Mar 5, 2026
sfc-gh-pbulawa
approved these changes
Mar 5, 2026
…tory_cache_is_not_available
…tory_cache_is_not_available
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Overview
Fixes a regression in v4.0.0 where SecureStorageLinuxManager throws an unrecoverable ExceptionInInitializerError when no HOME directory is available (e.g., Docker Linux containers). The root cause is FileCacheManager.getCacheFilePath() dereferencing a null cacheFile when the cache directory cannot be resolved. Rather than adding ad-hoc null checks (which is how this regression recurred from the original fix in #2108), this PR introduces an explicit cacheEnabled flag in FileCacheManager that is set only when cache setup succeeds. All public methods check this flag at the top and gracefully no-op when disabled, so the driver continues to function normally without token caching.