Skip to content

S3_PING.removeAll: log a failed listing instead of throwing MissingResourceException - #662

Merged
rhusar merged 1 commit into
jgroups-extras:mainfrom
rayliu2007:fix-s3ping-removeall-message
Oct 8, 2026
Merged

rhusar merged 1 commit into
jgroups-extras:mainfrom
rayliu2007:fix-s3ping-removeall-message

Conversation

@rayliu2007

@rayliu2007 rayliu2007 commented Oct 7, 2026 •

Copy link
Copy Markdown

When the listing in S3_PING.removeAll() fails (no credentials, AccessDenied, a network error), its catch block
reported it with Util.getMessage("FailedDeletingAllObjects"). That key is not in JGroups' jg-messages.properties
(5.5.4, 5.5.7 or master), so the report itself threw MissingResourceException:

  • the original exception was never logged, and
  • the exception escaped removeAll(). With remove_all_data_on_view_change="true" that method runs from
    FILE_PING.handleView(), inside down(VIEW_CHANGE) on the coordinator; we saw it fail JChannel.connect().
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key FailedDeletingAllObjects
	at org.jgroups.util.Util.getMessage(Util.java:247)
	at org.jgroups.protocols.aws.S3_PING.removeAll(S3_PING.java:331)
	at org.jgroups.protocols.FILE_PING.handleView(FILE_PING.java:220)
	at org.jgroups.protocols.FILE_PING.down(FILE_PING.java:154)
	...

The fix logs a formatted message with the exception, the way readAll() and write() in the same class already do,
so the protocol no longer depends on a key in JGroups' bundle.

S3_PINGRemoveAllTest gives S3_PING an S3Client whose every call fails and checks that removeAll() returns
normally. It fails on the current code with the exception above and passes with the change. It needs neither AWS
credentials nor a container.

@rayliu2007
rayliu2007 requested a review from rhusar as a code owner October 7, 2026 21:25
…sourceException

The catch block reported the failure with Util.getMessage("FailedDeletingAllObjects"), a key JGroups'
jg-messages.properties does not have, so the report threw MissingResourceException: the original exception
was lost and the new one escaped removeAll(), which runs from FILE_PING.handleView() during a view change.
Log a formatted message with the exception instead, as readAll() and write() do.

Signed-off-by: rliu3 <ray.liu@toronto.ca>
@rayliu2007
rayliu2007 force-pushed the fix-s3ping-removeall-message branch from 9f78776 to c946acc Compare October 7, 2026 21:27
@rhusar

rhusar commented Oct 7, 2026

Copy link
Copy Markdown
Member

Interesting, looks like a remnant when it was moved from main jgroups source. Ill resolve this tomorrow. Thanks for the PR! Letting ci run

@rhusar rhusar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

However, we really need to remove all the calls to that method as upstream can change and break the project without us even knowing. There is also a more polish that can happen here which is out of scope for this PR.

@rhusar
rhusar merged commit 7262b64 into jgroups-extras:main Oct 8, 2026
9 checks passed
@rhusar

rhusar commented Oct 8, 2026

Copy link
Copy Markdown
Member

Thank you @rayliu2007! I will add more fixes for this minor and cut a release.

@rhusar

rhusar commented Oct 8, 2026

Copy link
Copy Markdown
Member

Followup #663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants