Skip to content
This repository was archived by the owner on Aug 21, 2023. It is now read-only.

Conversation

@elbywan
Copy link
Contributor

@elbywan elbywan commented Dec 30, 2019

Issue

  • collection_command_simple call

It seems that the collection.cr command_simple function calls the LibMongoC.collection_command_simple binding with a missing argument.

In lib/mongo/src/mongo/collection.cr:63:18

 63 | if LibMongoC.collection_command_simple(self, command.to_bson, out reply, out error)
                   ^------------------------
Error: wrong number of arguments for 'LibMongoC#collection_command_simple' (given 4, expected 5)
  • streams in pooled mode

Custom streams using a TCPSocket were not connecting to the db properly when in pooled mode, since polling is dedicated to a background thread unlike in single thread mode.

Done

  • Added the mongo preferences prefs as a third argument to satisfy the call.
  • Fixes socket connection when in pooled mode by adding a connected bool as a class variable and forcing connection when requesting the socket and connected is false.

@elbywan elbywan changed the title fixes collection_command_simple call fixes collection_command_simple call and streams in pooled mode Jan 2, 2020
@datanoise datanoise merged commit 38c8714 into datanoise:master Jan 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants