Skip to content

System.NullReferenceException when creating a SniffingConnectionPool on Mono. #1634

Closed
@maeserichar

Description

@maeserichar

When using branch 2.0 on Mono 2.0.4, we are trying to create a SniffingConnectionPool, but we get a NRE with the following stack trace:

System.NullReferenceException : Object reference not set to an instance of an object
  at System.Uri.GetHashCode () [0x0001c] in /builddir/build/BUILD/mono-4.0.4/mcs/class/System/System/Uri.cs:821
  at System.Collections.Generic.DefaultComparer`1[System.Uri].GetHashCode (System.Uri obj) [0x0000d] in /builddir/build/BUILD/mono-4.0.4/mcs/class/corlib/System.Collections.Generic/EqualityComparer.cs:117
  at System.Collections.Generic.Dictionary`2[System.Uri,System.Collections.Generic.List`1[Elasticsearch.Net.Connection.Node]].Insert (System.Uri key, System.Collections.Generic.List`1 value, Boolean add) [0x00023] in /builddir/build/BUILD/mono-4.0.4/external/referencesource/mscorlib/system/collections/generic/dictionary.cs:319
  at System.Collections.Generic.Dictionary`2[System.Uri,System.Collections.Generic.List`1[Elasticsearch.Net.Connection.Node]].Add (System.Uri key, System.Collections.Generic.List`1 value) [0x00000] in /builddir/build/BUILD/mono-4.0.4/external/referencesource/mscorlib/system/collections/generic/dictionary.cs:185
  at System.Linq.Enumerable+<CreateGroupByIterator>c__Iterator5`2[Elasticsearch.Net.Connection.Node,System.Uri].MoveNext () [0x000e0] in /builddir/build/BUILD/mono-4.0.4/mcs/class/System.Core/System.Linq/Enumerable.cs:918
  at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[System.Linq.IGrouping`2[System.Uri,Elasticsearch.Net.Connection.Node],Elasticsearch.Net.Connection.Node].MoveNext () [0x00059] in /builddir/build/BUILD/mono-4.0.4/mcs/class/System.Core/System.Linq/Enumerable.cs:2266
  at System.Collections.Generic.List`1[Elasticsearch.Net.Connection.Node]..ctor (IEnumerable`1 collection) [0x0008b] in /builddir/build/BUILD/mono-4.0.4/external/referencesource/mscorlib/system/collections/generic/list.cs:105
  at System.Linq.Enumerable.ToList[Node] (IEnumerable`1 source) [0x00006] in /builddir/build/BUILD/mono-4.0.4/mcs/class/System.Core/System.Linq/Enumerable.cs:2948
  at Elasticsearch.Net.ConnectionPool.StaticConnectionPool..ctor (IEnumerable`1 nodes, Boolean randomize, IDateTimeProvider dateTimeProvider) [0x00000] in <filename unknown>:0
  at Elasticsearch.Net.ConnectionPool.StaticConnectionPool..ctor (IEnumerable`1 uris, Boolean randomize, IDateTimeProvider dateTimeProvider) [0x00000] in <filename unknown>:0
  at Elasticsearch.Net.ConnectionPool.SniffingConnectionPool..ctor (IEnumerable`1 uris, Boolean randomize, IDateTimeProvider dateTimeProvider) [0x00000] in <filename unknown>:0

Same code works on .Net without problems. If I modify the Purify method in Purify.cs to return the Uri unchanged on mono, it works, so it seems that the problem is in PurifierMono.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions