Search code examples
.netignite

Apache Ignite .net thin client "Too many open cursors" exception


Getting the following exception from the .net thin client performing both linq and SQL queries against an ignite cache

Exception : "Apache.Ignite.Core.Client.IgniteClientException: 50000: Too many open cursors (either close other open cursors or increase the limit through ClientConnectorConfiguration.maxOpenCursorsPerConnection) [maximum=128, current=128] at Apache.Ignite.Core.Impl.Client.Cache.CacheClient2.HandleError[T](ClientStatusCode status, String msg) at Apache.Ignite.Core.Impl.Client.ClientSocket.DecodeResponse[T](BinaryHeapStream stream, Func2 readFunc, Func3 errorFunc) at Apache.Ignite.Core.Impl.Client.ClientSocket.DoOutInOp[T](ClientOp opId, Action1 writeAction, Func2 readFunc, Func3 errorFunc) at Apache.Ignite.Core.Impl.Client.ClientFailoverSocket.DoOutInOp[T](ClientOp opId, Action1 writeAction, Func2 readFunc, Func3 errorFunc) at Apache.Ignite.Core.Impl.Client.Cache.CacheClient2.DoOutInOp[T](ClientOp opId, Action1 writeAction, Func2 readFunc) at Apache.Ignite.Core.Impl.Client.Cache.CacheClient2.Query[T](SqlFieldsQuery sqlFieldsQuery, Func3 readerFunc) at Apache.Ignite.Linq.Impl.CacheFieldsQueryExecutor.ExecuteSingle[T](QueryModel queryModel, Boolean returnDefaultWhenEmpty) at Remotion.Linq.Clauses.StreamedData.StreamedSingleValueInfo.ExecuteSingleQueryModel[T](QueryModel queryModel, IQueryExecutor executor) at Remotion.Linq.Clauses.StreamedData.StreamedSingleValueInfo.ExecuteQueryModel(QueryModel queryModel, IQueryExecutor executor) at Apache.Ignite.Linq.Impl.CacheFieldsQueryProvider.Execute[TResult](Expression expression)

The client application uses both Apache.Ignite.Linq and SQL Queries IFieldsQueryCursor

many of the sql queries use the Select clause to transform the IFieldsQueryCursor result into a IEnumerable


Solution

  • As the error suggests, you can change the ClientConnectorConfiguration.maxOpenCursorsPerConnection property (on your Ignite server nodes) to increase the number of cursors that can be opened simultaneously.

    Having said that, 128 sounds plenty! Are you sure you're closing all your cursors when you're finished with them? They're IDisposable, so it's a good idea to put them in using blocks.