-
Notifications
You must be signed in to change notification settings - Fork 151
Moped, bson + Rubinius 2.2.0 #231
Comments
btw, this might be a bson issue, but I just tried running their specs with rubinius 2.2 and it worked fine |
From the backtrace, looks like Mongo is using pthread internally. Hopefully, Mongo is not assuming that Ruby threads couldn't be running at the same time. Does this happen deterministically? Any chance you application is open-source or can you extract something that repros this? |
Any way to fix this issue? |
Wrong repository for this request :) The bson-ruby gem doesn't currently support rubinius, but we'd like to. You should be reporting/requesting this support over here: There's a ticket for this, but there's not been a lot of interest in it except for this thread. If you want to see it happen, feel free to vote up the ticket and let us know it's important to you. It's on my list to do, definitely, but low demand for it has made it sink to the bottom of the priority list. |
thanks @brandonblack for the response.. I will be closing this issue in here, as this is a known issue on bson gem. I might take a look into that as soon as possible too. thanks all. |
No problem. We actually plan to support Rubinius 2.0 and greater out of the gate in the new Ruby driver (which shares this same BSON implementation) but Moped is currently ahead of us in adoption of bson-ruby 2.0 and I don't think anyone on either team has had spare cycles to look into it. We'd love to take a PR if any of you have a solid solution ready to go though. Feel free to ping me. |
@pkieltyka quick question, what version of MongoDB was this error seen on? |
v2.4.8 Mon Nov 18 09:53:56.323 [initandlisten] build info: Darwin pak.local 13.0.2 Darwin Kernel Version 13.0.2: Sun Sep 29 19:38:57 PDT 2013; root:xnu-2422.75.4~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49 On Nov 18, 2013, at 12:41 PM, Brandon Black notifications@github.com wrote:
|
Great, thank you. We'll look into this. |
Thanks! On Nov 18, 2013, at 12:43 PM, Brandon Black notifications@github.com wrote:
|
@pkieltyka any chance you could extract a repro of this from your app? If you can, could you post it to the jira ticket listed above? If not, would you let me know under what conditions I could access your app to debug this? Feel free to email me. |
It’s a closed source project. But is Rbx2+mongoid-head+bson2 working for you guys? I just tried doing a simple Mongoid.default_session.command(ping: 1) and it simply can’t open a connection.. there isn’t anything special about the code wrt that. Could not connect to a primary node for replica set #<Moped::Cluster:323316 @seeds=[<Moped::Node resolved_address="127.0.0.1:27017">]> On Nov 18, 2013, at 12:54 PM, Brian Shirai notifications@github.com wrote:
|
Check your mongo logs On Mon, Nov 18, 2013 at 1:03 PM, Peter Kieltyka notifications@git.luolix.topwrote:
|
@pkieltyka I don't use Mongo so I can't say. I just want to see if there's anything broken in Rubinius that I can fix. If someone can throw a simple app up on GitHub and link me, that would be a huge help and I'm happy to dig into it. |
Ah ok, that makes sense. I will put together a vanilla app in a few minutes then On Nov 18, 2013, at 3:03 PM, Brian Shirai notifications@github.com wrote:
|
Here it is: https://github.com/pkieltyka/monrbx - just start it with bundle exec rails s, and hit localhost:3000/heartbeat .. try on both rbx and mri |
@pkieltyka awesome, thank you! I'll see what I can discover. |
Is this related to encoding in rbx or when converting symbol to string? Here's the result I tried:
|
Any update on this? Or is Mongoid currently Rubinius-incompatible? |
@meskyanichi I haven't had a chance to look into it yet, but thanks for the ping. I'll put it on the list this week. |
@brixen awesome, thanks a lot! |
FYI Mongoid 3 is so far working fine here on Rbx 2.2. Both in terms of test suites and the actual runtime. |
I’ve been trying mongoid-head and moped-head with Rbx 2.2.1 and no luck On Dec 17, 2013, at 7:58 AM, Yorick Peterse notifications@github.com wrote:
|
Haven't tried the HEAD versions so far so can't speak for those. 3.0 series works here though, what errors are you getting? |
I'm having the same problem, rails 4 and mongoid 4.beta1. Moped::Errors::ConnectionFailure:
Could not connect to a primary node for replica set #<Moped::Cluster:261928 @seeds=[<Moped::Node resolved_address="127.0.0.1:27017">]> I wish it will be fixed soon. |
👍 I have the same problem with rails 4 and mongoid 4.beta1. Any hint to fix it? |
Mongoid does not currently support Rubinius, nor does Moped. Support is a very low priority at this point and would be the last thing we look at for the moment. |
@durran Any particular reason for not supporting Rubinius? |
@yorickpeterse It was pretty much due to the fact that we did not consider Rubinius completely stable until 2.1, and keeping things working in it took too much time away from core issues. We will come back to it later, just won't be first priority. MRI and JRuby will always be top priority - but I would expect at least Rubinius 2.2 to be supported by the official Mongoid 4.0 release... Just will be the last thing we do. :) |
@durran Ok, thanks for the heads up. If you folks need any help/info feel free to ask! |
@durran can you say what sort of issues you're encountering with Rubinius relative to MRI? |
@brixen I'll make a list of outstanding stuff today and post it here. |
@durran that's terrific, thanks! |
@brixen I'm having issues with my local env at the moment after a recent os upgrade so haven't gotten rbx installed again locally. But do note I switched the mongodb-ruby-driver build on master to include rbx and all is good there so far on 2.2.5. The master branch of that driver is Moped's upcoming replacement. https://travis-ci.org/mongodb/mongo-ruby-driver/builds/18656988 |
@durran that's great to see! So, should I put any effort into getting Moped running on Rubinius? |
@brixen I'd say not to put any real effort into it, since it is getting replaced - unless maybe if it's a quick 1 liner then I see no harm. |
bson-ruby seems to convert everything to BINARY all over the place which for whatever reason results in the second value ("r" being dropped). According to |
class String will fix the issue on rbx 2.2.5 and rails 4 with head mongoid and moped |
on MRI 2.1.0:
on rbx 2.2.6:
I'm happy to use the solution @washu suggested, but I'm concerned that there may be a deeper bug that may have other effects. |
If there's a way to reproduce this error outside of Mongoid that would make it easier for us to find out what's going on with Rbx. I'm not familiar with the workings of |
@yorickpeterse , you don't need a full mongoid installation. The problem is with the bson gem, and is reproducible with one line in irb, as I illustrated above. (just require 'bson') The problem seems to be in BSON::String.to_utf8_binary which is def to_utf8_binary(encoded)
encoded << encode(UTF8).force_encoding(BINARY)
end where the encoded argument is a BINARY-encoded string. BSON::String is included in ::String. |
Just wanted to update, in case anyone else runs across this thread. rbx is currently working with the following mongoid, moped, and bson versions: |
I was just trying to boot my Rails 4.0.1 app that uses mongoid/moped head with Rubinius 2.2.0 and ran into some issues..
Rails output:
mongodb.log output:
i
The text was updated successfully, but these errors were encountered: