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

Add @transient to make the serialization check happy. #7424

Merged
merged 1 commit into from
Feb 6, 2019

Conversation

He-Pin
Copy link
Contributor

@He-Pin He-Pin commented Nov 13, 2018

No description provided.

@He-Pin
Copy link
Contributor Author

He-Pin commented Nov 13, 2018

Error Message
java.lang.AssertionError: assertion failed: instance = List(1, 2, 3) : class scala.collection.immutable.$colon$colon  serialization unstable: rO0ABXNyADJzY2FsYS5jb2xsZWN0aW9uLmdlbmVyaWMuRGVmYXVsdFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAADAwABTAAHZmFjdG9yeXQAGkxzY2FsYS9jb2xsZWN0aW9uL0ZhY3Rvcnk7eHBzcgAqc2NhbGEuY29sbGVjdGlvbi5JdGVyYWJsZUZhY3RvcnkkVG9GYWN0b3J5AAAAAAAAAAMCAAFMAAdmYWN0b3J5dAAiTHNjYWxhL2NvbGxlY3Rpb24vSXRlcmFibGVGYWN0b3J5O3hwc3IAJnNjYWxhLnJ1bnRpbWUuTW9kdWxlU2VyaWFsaXphdGlvblByb3h5AAAAAAAAAAECAAFMAAttb2R1bGVDbGFzc3QAEUxqYXZhL2xhbmcvQ2xhc3M7eHB2cgAgc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuTGlzdCQAAAAAAAAAAwIAAUwAEXBhcnRpYWxOb3RBcHBsaWVkdAARTHNjYWxhL0Z1bmN0aW9uMTt4cHcE/////3NyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAABc3EAfgAMAAAAAnNxAH4ADAAAAANzcQB+AAZ2cgAmc2NhbGEuY29sbGVjdGlvbi5nZW5lcmljLlNlcmlhbGl6ZUVuZCQAAAAAAAAAAwIAAHhweA==    found: rO0ABXNyADJzY2FsYS5jb2xsZWN0aW9uLmdlbmVyaWMuRGVmYXVsdFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAADAwABTAAHZmFjdG9yeXQAGkxzY2FsYS9jb2xsZWN0aW9uL0ZhY3Rvcnk7eHBzcgAqc2NhbGEuY29sbGVjdGlvbi5JdGVyYWJsZUZhY3RvcnkkVG9GYWN0b3J5AAAAAAAAAAMCAAFMAAdmYWN0b3J5dAAiTHNjYWxhL2NvbGxlY3Rpb24vSXRlcmFibGVGYWN0b3J5O3hwc3IAJnNjYWxhLnJ1bnRpbWUuTW9kdWxlU2VyaWFsaXphdGlvblByb3h5AAAAAAAAAAECAAFMAAttb2R1bGVDbGFzc3QAEUxqYXZhL2xhbmcvQ2xhc3M7eHB2cgAgc2NhbGEuY29sbGVjdGlvbi5pbW11dGFibGUuTGlzdCQAAAAAAAAAAwIAAHhwdwT/////c3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFzcQB+AAsAAAACc3EAfgALAAAAA3NxAH4ABnZyACZzY2FsYS5jb2xsZWN0aW9uLmdlbmVyaWMuU2VyaWFsaXplRW5kJAAAAAAAAAADAgAAeHB4
Stacktrace
sbt.ForkMain$ForkError: java.lang.AssertionError: assertion failed: instance = List(1, 2, 3) : class scala.collection.immutable.$colon$colon
 serialization unstable: rO0ABXNyADJzY2FsYS5jb2xsZWN0aW9uLmdlbmVyaWMuRGVmYXVsdFNlcmlhbGl6YXRpb25Qcm94eQAAAAAAAAADAwABTAAHZmFjdG9yeXQAGkxzY2FsYS9jb2xsZWN0aW9uL0ZhY3Rvcnk7eHBzcgAqc2NhbGEuY29sbGVjdGlvbi5JdGVyYWJsZUZhY3RvcnkkVG9GYWN0b3J5AAAAAAAAAAMCAAFMAAdmYWN0b3J5dAAiTHNjYWxhL2NvbGxlY3Rpb24vSXRlc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cAAAAAFzcQB+AAsAAAACc3EAfgALAAAAA3NxAH4ABnZyACZzY2FsYS5jb2xsZWN0aW9uLmdlbmVyaWMuU2VyaWFsaXplRW5kJAAAAAAAAAADAgAAeHB4
	at scala.SerializationStability$.main(SerializationStabilityTest.scala:85)
	at scala.SerializationStabilityTest.testAll(SerializationStabilityTest.scala:230)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.junit.runners.Suite.runChild(Suite.java:127)
	at org.junit.runners.Suite.runChild(Suite.java:26)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
	at com.novocode.junit.JUnitRunner$1.execute(JUnitRunner.java:132)
	at sbt.ForkMain$Run.lambda$runTest$1(ForkMain.java:304)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

@He-Pin
Copy link
Contributor Author

He-Pin commented Nov 14, 2018

@szeiger please take a look.

@He-Pin
Copy link
Contributor Author

He-Pin commented Nov 14, 2018

refs:scala/scala-dev#562

@He-Pin
Copy link
Contributor Author

He-Pin commented Dec 14, 2018

I encounter serialization errors once but not again.

@He-Pin He-Pin changed the title =col Add @transient to make the serialization check happy. Add @transient to make the serialization check happy. Dec 15, 2018
@SethTisue

This comment has been minimized.

@He-Pin
Copy link
Contributor Author

He-Pin commented Jan 12, 2019

rebased

Copy link
Contributor

@Ichoran Ichoran left a comment

Choose a reason for hiding this comment

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

This looks consistent with my admittedly rather shaky understanding of how Java serialization interacts with Scala objects.

@Ichoran
Copy link
Contributor

Ichoran commented Jan 14, 2019

@SethTisue - I'd feel more comfortable if Stefan looked over this one also, but would you rather merge it now on the basis of my less-expert understanding of how serialization interacts with companion objects?

@SethTisue
Copy link
Member

I'll leave the merge to @szeiger

@Ichoran
Copy link
Contributor

Ichoran commented Jan 23, 2019

@szeiger - Did you want to take a look at this?

@SethTisue
Copy link
Member

@hepin1989 under what circumstances were we seeing failures?

@He-Pin
Copy link
Contributor Author

He-Pin commented Feb 1, 2019

@SethTisue It occur when I run sbt test.

@He-Pin
Copy link
Contributor Author

He-Pin commented Feb 1, 2019

I rerun the current 2.13.x, test pass now, may this PR is not needed anymore.

@adriaanm adriaanm assigned szeiger and unassigned Ichoran Feb 4, 2019
@SethTisue
Copy link
Member

I rerun the current 2.13.x, test pass now, may this PR is not needed anymore.

we might as well save the bytes by not serializing unneeded stuff, though

@adriaanm adriaanm assigned SethTisue and unassigned szeiger Feb 6, 2019
@adriaanm
Copy link
Contributor

adriaanm commented Feb 6, 2019

Rebased

@SethTisue SethTisue merged commit 596c123 into scala:2.13.x Feb 6, 2019
@SethTisue
Copy link
Member

thanks @hepin1989 !

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.

6 participants