Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Make UVException Serializable (like all other exceptions) #1609

Closed
alextolp opened this issue Apr 5, 2017 · 6 comments
Closed

Make UVException Serializable (like all other exceptions) #1609

alextolp opened this issue Apr 5, 2017 · 6 comments

Comments

@alextolp
Copy link

alextolp commented Apr 5, 2017

I'm seeing the following error consistently when running unit tests against kestrel server. It seems to be benign and happens during cleanup.

Warning: System.Runtime.Serialization.SerializationException: Type 'Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException' in Assembly 'Microsoft.AspNetCore.Server.Kestrel, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' is not marked as serializable.
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
   at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeObject(Object obj, MemoryStream stm)
   at System.AppDomain.Serialize(Object o)
   at System.AppDomain.MarshalObject(Object o)

   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
   at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeObject(Object obj, MemoryStream stm)
   at System.AppDomain.Serialize(Object o)
   at System.AppDomain.MarshalObject(Object o)
@davidfowl
Copy link
Member

What exactly are you doing?

@alextolp
Copy link
Author

alextolp commented Apr 5, 2017

Looks like the original exception is due to this issue:

#946

After disposing the DI container, I'm no longer seeing this problem.

@davidfowl
Copy link
Member

That exception looks completely different but glad you solved it.

@alextolp
Copy link
Author

alextolp commented Apr 5, 2017

The UvException was wrapping the ObjectDisposedException described in #946. Ideally UvException would follow the pattern for all exceptions in the corefx and be Serializeable.

@davidfowl davidfowl reopened this Apr 5, 2017
@davidfowl davidfowl changed the title SerializationException: Type 'Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException' is not marked as serializable. Make UVException Serializable (like all other exceptions) Apr 5, 2017
@davidfowl
Copy link
Member

davidfowl commented Apr 5, 2017

@alextolp updated the title of the issue. Feel free to send a pull request for this one. Though I don't know if that's possible in netstandard 1.3. If not, it's not worth fixing IMO.

@muratg
Copy link
Contributor

muratg commented Apr 18, 2017

We may accept a PR, though closing the bug.

@muratg muratg closed this as completed Apr 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants