ivandasch commented on a change in pull request #9044:
URL: https://github.com/apache/ignite/pull/9044#discussion_r635127877



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
##########
@@ -2385,12 +2388,30 @@ private void onCacheStarted(GridCacheContext cacheCtx) 
throws IgniteCheckedExcep
                 ", mode=" + cfg.getCacheMode() +
                 ", atomicity=" + cfg.getAtomicityMode() +
                 ", backups=" + cfg.getBackups() +
-                ", mvcc=" + cacheCtx.mvccEnabled() + ']');
+                ", mvcc=" + cacheCtx.mvccEnabled() +
+                (cacheCtx.expiry() != null ? ", " + 
buildExpirePolicyInfo(cacheCtx) : "") + ']');
         }
 
         return cacheCtx;
     }
 
+    /**
+     * Get formatted string with expire policy info.
+     *
+     * @param cacheCtx - grid cache context.
+     * @return formatted expire policy info.
+     */
+    private String buildExpirePolicyInfo(GridCacheContext cacheCtx) {
+        ExpiryPolicy expPlc = cacheCtx.expiry();
+
+        Duration dur = expPlc.getExpiryForCreation() != null ? 
expPlc.getExpiryForCreation() :

Review comment:
       Thin clients use 
`org.apache.ignite.internal.processors.platform.cache.expiry.PlatformExpiryPolicy`
   It contains field 
`org.apache.ignite.internal.processors.platform.cache.expiry.PlatformExpiryPolicy#DUR_UNCHANGED`
   If thin client pass it, thin client handler convert it to `null`. In tests 
one of parameter is `ExpiryPolicy()` with all fields `DUR_UNCHANGED`. And this 
case cause NPE in your code. 
   
   Thids is absolutely valid case, so as I suggested, just logs three 
durations, preferrably in seconds, I suppose (floating point number and prepend 
's', something like `...., expirePolicy=[create=0.1s, update=0.1s, 
access=0.1s], isEagerTtl=false]`)




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to