Comments (6)
From [email protected] on August 13, 2010 15:08:35
If you have a deep object graph, for each level of the graph you will dump a message and a stacktrace. This can make it confusing to determine where the error really occurred.
Is the TRACE log level enough to debug serialization problems? Call "Log.TRACE();" to enable. FieldSerializer tells you what it is about to do, so if it fails you will know what field failed. Eg, with this logging you would know that the someOtherField field on the com.example.SomeClass is where the failure occurred:
...
00:00 TRACE: [kryo] Reading field: someIntField (com.example.SomeClass)
00:00 TRACE: [kryo] Read int: 1234
00:00 TRACE: [kryo] Reading field: someOtherField (com.example.SomeClass)
// Some exception and stacktrace.
from kryo.
From martin.grotzke on August 14, 2010 04:16:12
My case is an application running in production where in seldom cases deserialization fails. I can't enable tracing as this probably would kill the server, there are lots of requests. As operations is not under our control it's not so easy to enable trace for only one server, excluding it from load balancing and trying to reproduce the exceptional situation.
Therefore, if an error occurs I only have what's logged for this error (without trace being turned on).
What you say is correct: it would be better to log only the root cause and throw a custom exception that can be passed through (I have no access to my laptop until tomorrow evening so I can't do this right now). Still, also the provided patch would help me to debug deserialization errors.
from kryo.
From martin.grotzke on August 16, 2010 15:56:36
Here's another patch that should print the exception only for the root cause.
I chose a kryo Context based solution as I could keep this "logic" as local as possible with this. With a custom RuntimeException (e.g. a subclass of SerializationException) wrapping the original exception (perhaps also a SerializationException?) other things might be affected. Also introducing an additional exception for this very special requirement seemed a little bit too much for me.
What do you think?
Attachment: FieldSerializer.java.2.patch
from kryo.
From [email protected] on August 16, 2010 21:35:56
This issue was closed by revision r113.
Status: Fixed
from kryo.
From [email protected] on August 16, 2010 21:40:13
You're right that more information is needed when trace isn't or can't be enabled. After some thought, I augmented SerializationException to allow arbitrary trace information to be appended. I updated Kryo and the object serializers to juggle exceptions properly to make use of this. As part of the exception message, you will now get a list of classes and fields that led up to the serialization or deserialization failure. Note that 3rd party serializers may not add trace info to the SerializationException.
from kryo.
From [email protected] on August 16, 2010 21:41:15
Issue 24 has been merged into this issue.
from kryo.
Related Issues (20)
- General approach to Java collections? -> UnmodifiableCollections do not seem to be de/serializable using Kryo HOT 1
- Redisson 3.24.3 java.lang.NoClassDefFoundError: com/esotericsoftware/kryo/serializers/DefaultSerializers$UUIDSerializer HOT 2
- Spring microservice encounters infinite loop when calling readLongs method resulting in denied access. HOT 3
- Could not serialize Lambda. If anyone knows this, then please response. HOT 6
- Compatibility issue between 5.5.0 and 5.6.0 HOT 2
- failed to lazily initialize a collection, no session or session was closed while trying to deserialize SPRING_SECURITY_CONTEXT HOT 3
- Add GregorianCalendar default serializer HOT 1
- Maven artifact not found HOT 4
- Encountered ArrayIndexOutOfBoundsException when running in Apache Spark 3.3.1 HOT 3
- Allow Kryo instances to be compared using .equals() & .hashcode() HOT 3
- deserialize failure in JDK 21 HOT 5
- When an anonymous inner class is used to initialize a collection, the elements are doubled. HOT 1
- Kryo5 deserialization lost Locale script field HOT 1
- The Input class changes its buffer when deserialize a string HOT 3
- About how to build serializer by custom self-reference class HOT 4
- Cannot run benchmarks HOT 4
- Urgent: Data Corruption Issue Identified During DTO Deserialization (Instance Variable Renamed/Type Changed) HOT 10
- schema validation failed while deserialize data serialized by Encoder.Bean Serializer using Kryo. HOT 2
- Comparison with ObjectInputStream and ObjectOutputStream HOT 2
- How to configure CompatibleFieldSerializer in Kryo3 ? HOT 2
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 kryo.