HarshMehta112 commented on issue #9085:
URL: https://github.com/apache/gravitino/issues/9085#issuecomment-3519983324

   @justinmclean I see two possible approaches for handling very small 
jobStatusKeepTimeInMs values:
   
   **Approach 1: Validate Early**  
   - Throw if value < 10ms   
   `if (jobStatusKeepTimeInMs < 10) throw new IllegalArgumentException();`
   `scheduleCleanupTask(jobStatusKeepTimeInMs);`
   
   **Approach 2:**
   - Instead of throwing, automatically adjust very small values to a safe 
minimum
    `scheduleCleanupTask(Math.max(jobStatusKeepTimeInMs, 10));`
   
   I tend to lean towards Approach 1 because it fails fast and clearly signals 
misconfiguration, which can prevent subtle bugs later. Approach 2 is simpler 
for the caller, but it might silently hide a misconfigured value.
   
   What do you think is the better approach in this case? 


-- 
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: [email protected]

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

Reply via email to