infinispan / infinispan/protostream

Unable to remove @ProtoAdapter and all subClassNames marshallers from SerializationContext

Open
#588 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
56
Forks
39
Avg merge
5h 36m
Merged PRs (30d)
5

Description

It is not possible to cleanly remove all of the marshallers from the SerializationContext when using a `@ProtoAdapter`. I tried doing:

```
var marshaller = ctx.getMarshallerDelegate(ProtoStreamTypeIds.ADAPTER_LIST).getMarshaller();
ctx.unregisterMarshaller(marshaller);
```

However this does not remove all of the `subClassNames` marshaller instances from the `marshallersByClass`. We need a solution that allows us to remove a `@ProtoAdapter` marshaller and all state/marshallers associated with it and its configured `subClassNames`.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing SerializationContext.getMarshallerDelegate and unregisterMarshaller, then inspect how marshallersByClass stores the main @ProtoAdapter marshaller and its configured subClassNames instances. Done means removing the adapter also removes all associated state and marshallers, with no remaining subclass entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.