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

Parent scope can be set just once #687

Closed
fericit-bostan opened this issue Aug 12, 2019 · 1 comment
Closed

Parent scope can be set just once #687

fericit-bostan opened this issue Aug 12, 2019 · 1 comment

Comments

@fericit-bostan
Copy link

fericit-bostan commented Aug 12, 2019

I'm having an issue with Kryo producing a RuntimeException on occasion with the message "Parent scope can be set just once". The version of Kryo that we are using it 2.22.

I do understand that this can happen in a multi-threaded environment when reusing the Kryo instance, as it is not thread safe. However, I am using Apache commons-pool (PooledObjectFactory) to ensure that the Kryo instance is used by only a single thread at any given time. Because of the version of Kryo that we are using I don't have access to the Kryo Pool class, which is why I am using the Apache PooledObjectFactory.

Is there something that I must do to the Kryo instance when returning a given instance to the Pool to perform some sort of reset? I'm not setting autoReset on the Kryo instance so it should be set to true by default. I've verified the usage of the PooledObjectFactory to ensure that we borrow the instance from the ObjectPool to acquire the Kryo instance and that the instance is then returned to the ObjectPool when done, so I don't believe that there is any leakage pertaining to the usage.

We have also been receiving numerous ClassCastExceptions and some appearing just prior to the RuntimeException. I can reproduce the issue with a unit test but I think that they are related to #384, but I don't know if they could cause the RuntimeException (Parent scope can be set just once). I'm guessing not as I don't see a conclusive pattern between the two.

Any suggestions would be greatly appreciated.
Thanks...

@theigl
Copy link
Collaborator

theigl commented Dec 3, 2020

Closing old issues. Please re-open if this is still relevant to you.

@theigl theigl closed this as completed Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants