thswlsqls opened a new pull request, #17271:
URL: https://github.com/apache/iceberg/pull/17271

   
   Closes #17270
   
   ## Summary
   
   - `EcsCatalog.setProperties()` and `removeProperties()` leaked the vendor 
exception `com.emc.object.s3.S3Exception` (404 `NoSuchKey`) for a missing 
namespace.
   - Both delegate to `updateProperties()`, which called `loadProperties()` 
with no existence check; `loadProperties()` does not translate 404, unlike 
`objectMetadata()`.
   - Every sibling catalog supporting namespace properties checks first — 
`InMemoryCatalog`, `JdbcCatalog`, `GlueCatalog` — as does 
`loadNamespaceMetadata()` here. `EcsCatalog` was the only leak.
   - Both signatures already declare `throws NoSuchNamespaceException`. 
`SupportsNamespaces` marks that `@throws` `(optional)`, which permits not 
throwing — not leaking a vendor exception.
   - `Namespace.empty()` (root) has no properties object, so it now raises 
`NoSuchNamespaceException` rather than `S3Exception`; only the exception type 
changes.
   
   The check follows the dominant idiom in this class (`listNamespaces()`, 
`dropNamespace()`):
   
   ```java
   if (!namespaceExists(namespace)) {
     throw new NoSuchNamespaceException("Namespace %s does not exist", 
namespace);
   }
   ```
   
   ## Testing done
   
   - Added `TestEcsCatalog#namespacePropertiesOfMissingNamespace` covering both 
methods; it fails on `main` with `S3Exception`.
   - `./gradlew :iceberg-dell:check` — 26 tests passed.
   - `dell/` is outside the published REVAPI modules, so no revapi run.
   


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


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

Reply via email to