@avibryant Wow. I had to rewrite it to understand it. if (!_ok && Math.random() <= 0.1) { return res; }. It’s also in dire need of a comment
-
-
-
@bgreenlee and I'm 90% certain it doesn't do what the author intended. -
@avibryant@bgreenlee I thought I had it, then I realized _ok is a public field, and also we're in an abstract class -
@mcfunley@bgreenlee wait... what?
End of conversation
New conversation -
-
-
//.
@avibryant@awgross // if not ok, return res 10% of the time. if (!_ok && Math.random() <= 0.1) return res; -
.
@cathodion@awgross right, so log the first exception but only 90% o subsequent ones. Wait, what? -
@avibryant@awgross I dunno man, but at least it's predictably random.
End of conversation
New conversation -
-
-
@avibryant lololol. mongo-java-driver? OH THAT WAY MADNESS LIES! -
@JorgeO luckily, I wasn't actually working with this code. Yet. (But what is the best mongo+scala driver? Wish there were mongo-finagle.) -
@avibryant We use Rogue (http://github.com/foursquare/rogue …) on top of mongo-java-driver. At some point we'll have to break down & write mongo-finagle.
End of conversation
New conversation -
-
-
@avibryant "If not under ok, then it's true otherwise if random's more than a tenth."#mongoproverbs -
@arnabdotorg@avibryant If it's not ok, And random's less than a tenth, It's res. Sounds legit.#mongohaikus
End of conversation
New conversation -
-
-
@avibryant: stochastic errors are a well-understood phenomenon in biology; this is obviously some bold, next-level interdisciplinary workThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I got it :) RT
@avibryant: It's amazing how many times you can say "wait, what?" in a row while trying to understand https://github.com/mongodb/mongo-java-driver/blob/master/src/main/com/mongodb/ConnectionStatus.java#L213 …Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@avibryant@gianp Wow! Is there a reasonable explanation for the random behavior? -
@sorendebois as far as we can deduce it was meant to reduce logging volume to 10%, but got refactored to return "ok" randomly. -
@gianp - “Man, that’s a lot of error messages in the log.” - “Yeah, maybe see if you can do something about that.” -
@sorendebois "people keep saying MongoDB is terrible because it spews errors all the time!" "It's ok, I have a patch..."
End of conversation
New conversation -
-
-
@avibryant I wonder at what point did the... erm... author consider that code might be a tad shit. I'm betting never. /cc@channingwalton -
@tarkaTheRotter@avibryant it certainly caused me to say WTF quite a lot, it's truly bizarre.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.