Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#82: ClassCastException after Plugin update on DC #88

Merged
merged 16 commits into from
Sep 10, 2023

Conversation

Tiliavir
Copy link
Member

@Tiliavir Tiliavir commented Feb 5, 2022

Besides other posts regarding this issue in the "Atlassian Developer Community" this one summarizes it quite well:

[...] is caused by the fact during cache replication in Data Center RMI uses webapp class loader to deserialize cache invalidation message and not OSGi class loader associated with your plugin’s OSGi bundle.
The easiest way to work around this problem is to use keys that can be serialized/deserialized by webapp class loader (e.g. java.lang.String) [...]

and further

The Atlassian guide on using Data Centre Compatible caches here 19 says the cache can contain keys and values that implement Serializable however from what I have seen serializing pojos does not work as there are different classloaders in play which results in ClassCastException.

Following that, I've added this PR that should address this issue in a self healing way. Meaning: The issue might occur again after an environment gets this patch (and requires a manual plugin cache reset / reboot once again), but should be fixed for all following updates.

- BandanaManager.init() is called initially
- removes workaround with clone
- serialization of Signature to JSON using GSON
private void save(Signature signature) {
if (signature.hasMissingSignatures())
bandanaManager.setValue(GLOBAL_CONTEXT, signature.getKey(), signature);
if (value instanceof String) {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@Tiliavir Tiliavir self-assigned this Feb 10, 2022
@Tiliavir Tiliavir added this to Review in progress in CoP Open-Source Feb 10, 2022
@MarkusTiede
Copy link
Member

@Tiliavir asks to review this commit : b86a2cf

@Tiliavir
Copy link
Member Author

Tiliavir commented Feb 15, 2022

Tests to be performed before release:

After Release

@MarkusTiede MarkusTiede moved this from Review in progress to In progress in CoP Open-Source May 5, 2022
@Tiliavir Tiliavir force-pushed the feature/82_cache-issue branch 2 times, most recently from ae91b9d to be8de5f Compare June 6, 2022 16:03
@Tiliavir
Copy link
Member Author

Tiliavir commented Dec 4, 2022

debuggen with:

  docker run -e JVM_SUPPORT_RECOMMENDED_ARGS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005" -v confluenceVolume:/var/atlassian/application-data/confluence --name=confluence -d -p 5005:5005 -p 8090:8090 -p 8091:8091 atlassian/confluence-server:latest

https://matveevlife.wordpress.com/2020/05/04/run-atlassian-confluence-docker-in-debug-mode-and-with-jmx-on/

  • test deploy undeploy deploy
    if ok - test update
  • test deploy

@Tiliavir Tiliavir removed this from In progress in CoP Open-Source May 5, 2023
@Tiliavir Tiliavir merged commit 6409687 into main Sep 10, 2023
1 check passed
@Tiliavir Tiliavir deleted the feature/82_cache-issue branch September 10, 2023 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants