Priyesh Karatha created HDDS-15950:
--------------------------------------

             Summary: S3 Gateway GetBucketLifecycleConfiguration throws 
NullPointerException when expiration uses Date or DaysAfterInitiation is absent
                 Key: HDDS-15950
                 URL: https://issues.apache.org/jira/browse/HDDS-15950
             Project: Apache Ozone
          Issue Type: Sub-task
          Components: S3
            Reporter: Priyesh Karatha
            Assignee: Priyesh Karatha


{{S3LifecycleConfiguration.convertFromOzoneExpiration()}} calls 
{{ozoneExpiration.getDays() > 0}} (line 482). However, 
{{OzoneLifecycleConfiguration.OzoneLCExpiration.getDays()}} returns a nullable 
{{{}Integer{}}}. If a lifecycle rule is stored with a {*}Date{*}-based 
expiration (without a {{Days}} field), {{getDays()}} returns {{{}null{}}}. The 
comparison triggers auto-unboxing of the {{{}Integer{}}}, resulting in a 
{{{}NullPointerException{}}}, which propagates to the client as an HTTP 500 
response.

The same issue exists in {{convertFromOzoneAbortIncompleteMultipartUpload()}} 
(line 500), where {{getDaysAfterInitiation()}} also returns a nullable 
{{Integer}} and is compared without a null check.

There are currently no tests covering the GET lifecycle path for rules that use 
{*}Date{*}-based expiration, allowing this regression to go undetected.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to