Comments (5)
Hi @benwimpory
if you can supply a test case that demonstrates the problem, then please do. The library should work in the situation you describe (or at least fail with a reasonable message).
from chronicle-wire.
@epickrram Unit test that demonstrates the issue...
package wireobject;
import net.openhft.chronicle.queue.ChronicleQueue;
import net.openhft.chronicle.queue.ExcerptAppender;
import net.openhft.chronicle.queue.impl.single.SingleChronicleQueueBuilder;
import net.openhft.chronicle.wire.DocumentContext;
import org.junit.Test;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class WireObjectTest
{
@Test(expected = StackOverflowError.class)
public void shouldAppendBToQueue()
{
final B b = new B(new ArrayList<>(10), 2);
final ChronicleQueue queue = SingleChronicleQueueBuilder.binary("/tmp/testqueue").build();
final ExcerptAppender appender = queue.acquireAppender();
try (DocumentContext ctx = appender.writingDocument())
{
ctx.wire().getValueOut().object(b);
}
}
}
class A implements Serializable
{
private List<B> listOfB;
public A(List<B> listOfB)
{
this.listOfB = listOfB;
}
public List<B> getListOfB()
{
return listOfB;
}
}
class B extends A
{
private int x;
public B(List<B> listOfB, int x)
{
super(listOfB);
this.x = x;
}
public int getX()
{
return x;
}
}
from chronicle-wire.
Thanks for the test case, this issue will be prioritised and fixed in due course.
from chronicle-wire.
This use case is not currently supported and is not simple to fix, as chronicle-wire first builds its data structures then propagates them with data, see
see net.openhft.chronicle.wire.Wires#writeMarshallable(java.lang.Object, net.openhft.chronicle.wire.WireOut)
public static void writeMarshallable(@NotNull Object marshallable, @NotNull WireOut wire) {
WireMarshaller wm = WireMarshaller.WIRE_MARSHALLER_CL.get(marshallable.getClass());
wm.writeMarshallable(marshallable, wire);
}
( As I know you are aware ) The problem with your test case, is although your data is not recursive, your data structure ( used by chronicle-wire for mapping your data off heap ) is, and chronicle-wire gets a stack overflow building your data structure.
Thanks for reporting this issue if you required this issue to be fixed promptly please consider purchasing a support contract by contacting [email protected].
Chronicle-Wire does not currently support this use case and as such - We going to mark this as wont fix. If however you would like it fixed, please purchase a support contract.
I thank you again for reporting this issue and sorry that we are not able to fix it on this occasion.
from chronicle-wire.
from chronicle-wire.
Related Issues (20)
- Improve efficiency of writing MessageHistory as bytes HOT 1
- Support SizeLongConvertor for K, M, G, T suffix sizes HOT 1
- Add README Documentation for the different supported LongConverters
- commentListener is called multiple times when TextWire saves and reads unexpected fields HOT 1
- Investigate unsafe reuse of StringBuilder in YamlWireOut
- Fix MessageHistoryTest to run with history.as.bytes=true on mac
- JSONWire to parse doubles/ints surrounded by quotes HOT 2
- SelfDescribingTriviallyCopyable fails on Mac with Java17 or newer
- examples in documentation need to be updated to latest version of code
- Wire MethodReader fails to clear List before populating HOT 4
- Anchor is ignored and alias is not found when dealing with text fields HOT 2
- Improve copyTo for JSON <-> YAML, and handling of true/false values HOT 1
- Create a common YAML ConfigLoader to use in leaf projects HOT 2
- JSONWire fails to skip ignored object when a typed abstract class is skipped HOT 1
- WireMarshaller becomes recursive on self-referenced field HOT 5
- JSON wire fail to deserialize if you provide an object HOT 3
- Added the the service name to the message history
- At least some sequence() overloads fail to properly deserialize nested JSON with types
- Deprecate WireType.COMPRESSED_BINARY
- Generated Method Reader using wrong recycled object when reading HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chronicle-wire.