Closed GoogleCodeExporter closed 8 years ago
I wanted to add that I am using the latest version available through nuget
Original comment by kaiser...@gmail.com
on 20 Nov 2012 at 4:36
k: will look, thanks
Original comment by marc.gravell
on 20 Nov 2012 at 5:35
Cannot reproduce - looks fine:
[Test]
public void TestIncrementOnHashThatDoesntExist()
{
using (var conn = Config.GetUnsecuredConnection())
{
conn.Keys.Remove(0, "keynotexist");
var result = conn.Wait(conn.Hashes.Increment(0, "keynotexist", "fieldnotexist", 1));
Assert.AreEqual(1, result);
}
}
are you sure you didn't simply forget to open the connection?
Original comment by marc.gravell
on 21 Nov 2012 at 7:23
also tested:
conn.Keys.Remove(0, "keynotexist");
var result1 = conn.Wait(conn.Hashes.Increment(0, "keynotexist", "fieldnotexist", 1));
var result2 = conn.Wait(conn.Hashes.Increment(0, "keynotexist", "anotherfieldnotexist", 1));
Assert.AreEqual(1, result1);
Assert.AreEqual(1, result2);
Original comment by marc.gravell
on 21 Nov 2012 at 7:30
I am sure the conn is open because the data IS written to redis, I just never
get anything back after the wait. I'll see if I can repo it outside my app. If
I can I'll attach the project
Original comment by kaiser...@gmail.com
on 21 Nov 2012 at 4:45
Any chance this is related to transactions in some way?
Original comment by marc.gravell
on 21 Nov 2012 at 5:05
Doubt it. I managed to reproduce it, and now that I am looking at it in
isolation I think either I am missing something or I might have found a bug in
the async stuff (or at least how I/booksleeve is using it).
Check out the attached proj (you will need to restore the nugget paks... 32bit
redis server/client included for ease) Click the button. you should see an
alert with the value returned from redis. I can click it several times and
nothing ever happens. As soon as I used the debugger to step into the call and
follow the stack all the way to hashes.increment and back again it works.
Everything may be fine from Booksleeves point of view, but why would this not
be working until I step through it?
Let me know if you need clarification
Original comment by kaiser...@gmail.com
on 21 Nov 2012 at 5:52
Attachments:
Have you had a chance to look at this?
Original comment by kaiser...@gmail.com
on 28 Nov 2012 at 8:54
Sorry, first on my list for tomorrow morning. Promise!
Original comment by marc.gravell
on 28 Nov 2012 at 9:08
Nothing to do with BookSleeve; everything to do with MVC + async.
http://stackoverflow.com/questions/13621647/using-async-even-if-it-should-comple
te-as-part-of-a-mvc-route-deadlocks-the
Original comment by marc.gravell
on 29 Nov 2012 at 8:30
btw, the "quick fix" here is to have just:
public Task<long> IncrementCount(string value)
{
return RedisManager.Connection.Hashes.Increment(db, "testkey", value);
}
It is the addition of the async method that glitches it. I'm still interested
to see if SO has any ideas...
Original comment by marc.gravell
on 29 Nov 2012 at 9:04
Various other options have been added on SO. Closing, unless you think I've
missed anything.
Original comment by marc.gravell
on 29 Nov 2012 at 9:30
Awesome, thanks for your help.
Original comment by kaiser...@gmail.com
on 29 Nov 2012 at 5:36
Original issue reported on code.google.com by
kaiser...@gmail.com
on 20 Nov 2012 at 4:35