Code Monkey home page Code Monkey logo

booksleeve's People

Contributors

mgravell avatar

Watchers

 avatar

booksleeve's Issues

GetInt64 only supports Int32, not Int64

What steps will reproduce the problem?
1. Save a value to Redis that will fit in an Int64, but not an Int32.
2. Call connection.Strings.GetInt64(db, key);

What is the expected output? What do you see instead?
Expected the saved value, got an exception instead:
System.OverflowException occurred
  HResult=-2146233066
  Message=Value was either too large or too small for an Int32.
  Source=mscorlib
  StackTrace:
       at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
       at System.Int32.Parse(String s)
       at BookSleeve.RedisResult.get_ValueInt64() in c:\Dev\BookSleeve\BookSleeve\RedisResult.cs:line 36

What version of the product are you using? On what operating system?
NuGet 1.2.0.4

Please provide any additional information below.
I think this is a quick fix to line 36 of RedisResult.cs to change int.Parse to 
Int64.Parse.

Original issue reported on code.google.com by [email protected] on 3 Dec 2012 at 4:06

Bad performance in high load scenarios due to absence of buffer on network access.

What steps will reproduce the problem?
1.Try to execute a command with a lot of arguments, e.g. MSET or MGET with 20 
000 keys. 
2.All the arguments from will be sent as a separate network package, e.g. it 
would look like the following (each line is a separate TCP package)
*
20001
\r\n
$
4
MGET
\r\n
$
4
key1
\r\n
$
4
key2
\r\n

It is because data is not buffering but each pice of data is sent directly to 
NetworkStream, which wrapps the socket.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?
Booksleeve 0.9, Win 2008 x64 R2

Please provide any additional information below.
I observed such behavior by WireShark network sniffer, I simply added a buffer 
to write the whole command into MemoryStream, which then flushed to 
NetworkStream, and get 10x times better performance for my test where 1 thread 
tries to do Read and then Write 20000 keys from/to Redis with 32 bytes length 
random values.

Original issue reported on code.google.com by [email protected] on 16 Aug 2011 at 8:25

Queue is closed on BlockingQueue

What steps will reproduce the problem?
1. Blast the BlockingQueue with messages
2. Shutdown is called due to ReadReplyHeader::NetworkStream having 0 bytes read

Why would this be a failure?



Original issue reported on code.google.com by [email protected] on 14 Jun 2011 at 7:45

System.OutOfMemoryException when creating lots of connections

What steps will reproduce the problem?
Unknown - the problem seems to happen randomly

What is the expected output? What do you see instead?
I'm attempting to open a connection periodically for the purposes of a 
shortlived subscription. After opening the connection I dispose it. Disposal is 
guaranteed, so there's no connection left lying around. Sometimes, my first 
attempt to open a connection results in an OutOfMemory Exception. At the time 
that this happens, the application has only been maintaining one open Redis 
connection for a number of hours (anywhere from 6-24 hours). The application is 
using less than 100mb of memory and there is *plenty* of spare memory on the 
system when the exception is thrown. I have checked over my application 
thoroughly and there are no undisposed resources lying around not being cleaned 
up.

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' 
was thrown.
   at System.Threading.Thread.StartInternal(IPrincipal principal, StackCrawlMark& stackMark)
   at System.Threading.Thread.Start(StackCrawlMark& stackMark)
   at System.Threading.Thread.Start()
   at BookSleeve.RedisConnectionBase.Open() in c:\Dev\BookSleeve\BookSleeve\RedisConnectionBase.cs:line 231
   at Systemizer.Net.RedisConnectionGateway.CreateConnection() in c:\build-system\systemizer\source\Libraries\Systemizer\Net\RedisConnectionGateway.cs:line 69

What version of the product are you using? On what operating system?
The BookSleeve assembly version is 1.2.0.5.

Original issue reported on code.google.com by [email protected] on 23 Jan 2013 at 5:23

Subscribe method returns before subscription is setup on redis

This will be tricky to reproduce but here's what I'm doing:

- Build and run redis on windows (https://github.com/MSOpenTech/redis).
- Run redis-server and redis-cli
- In the redis-cli run the MONITOR command so that you can see the redis 
commands

I'm implementing the redis/SignalR message bus 
(https://github.com/SignalR/SignalR.Redis/blob/new-scaleout/SignalR.Redis/RedisM
essageBus.cs) and I'm seeing an issue where the Subscribe method is returning 
without a subscription being fully setup on redis. The method returns void so 
it seems there's no way to wait until that happens.

This block of code:
https://github.com/SignalR/SignalR.Redis/blob/new-scaleout/SignalR.Redis/RedisMe
ssageBus.cs#L32

Is the one giving trouble since the task returns and I'm able to send to the 
connection without the subscription being setup. This causes me to miss 
messages. 

The current hack I have is to do something like this:
while (_channel.SubscriptionCount == 0)
{
    System.Threading.Thread.Sleep(500);
}

It's horrible but it's temporary until I find a solution or workaround.


Original issue reported on code.google.com by [email protected] on 17 Sep 2012 at 9:16

Environment.TickCount usage in RedisConnection

Was going over your latest changes and notices you're using 
Environment.TickCount in RedisConnection.cs
I was just bitten by it a few days ago because TickCount turns negative after a 
server is up for ~30 days. Don't know if this is a problem in your usage but 
DateTime.UtcNow.Ticks might be safer.

Original issue reported on code.google.com by eyalpost on 22 Mar 2013 at 12:06

Add the EXPIREAT command

Currently there is no support for the EXPIREAT command. Is there a reason that 
it is not supported?



Original issue reported on code.google.com by [email protected] on 11 Nov 2013 at 8:31

Make booksleeve compile under mono 2.10

What steps will reproduce the problem?
1.Open Booksleeve project in Monodevelop 3.0.3.2 (Mono 2.10.8.1)
2.Change project to compile in target framework Mono / .Net $.)
3.Disable Assembly Signing

What is the expected output? What do you see instead?

I got a compilation error:

/home/michael/dev/booksleeve/BookSleeve/RedisConnectionBase.cs(310,40): error 
CS1061: Type `System.Net.Sockets.SocketAsyncEventArgs' does not contain a 
definition for `ConnectSocket' and no extension method `ConnectSocket' of type 
`System.Net.Sockets.SocketAsyncEventArgs' could be found (are you missing a 
using directive or an assembly reference?)


What version of the product are you using? On what operating system?

I'm compiling the head revision
The OS is Ubuntu 13.04

Please provide any additional information below.

I changed the RedisConnectionBase class to make the project compile
Here is the output of "hg diff"

@@ -10,9 +10,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>BookSleeve</RootNamespace>
     <AssemblyName>BookSleeve</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
-    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -34,9 +32,6 @@
     <DocumentationFile>bin\Release\BookSleeve.xml</DocumentationFile>
   </PropertyGroup>
   <PropertyGroup>
-    <SignAssembly>true</SignAssembly>
-  </PropertyGroup>
-  <PropertyGroup>
     <AssemblyOriginatorKeyFile>BookSleeve.pfx</AssemblyOriginatorKeyFile>
   </PropertyGroup>
   <ItemGroup>
diff -r 12677b78dd2b BookSleeve/RedisConnectionBase.cs
--- a/BookSleeve/RedisConnectionBase.cs Sat May 11 19:56:53 2013 +0100
+++ b/BookSleeve/RedisConnectionBase.cs Sun May 12 09:13:22 2013 -0400
@@ -191,10 +191,12 @@
             catch { }
             try { if (outBuffer != null) outBuffer.Dispose(); }
             catch { }
-            try { if (socket != null) {                
+            try { if (socket != null) {
+                if (socket.Connected) {
                 Trace("dispose", "closing socket...");
                 socket.Shutdown(SocketShutdown.Both);
                 socket.Close();
+            }
                 socket.Dispose();
                 Trace("dispose", "closed socket");                
             } } catch (Exception ex){
@@ -285,7 +287,7 @@
         private void ConnectAsync(TaskCompletionSource<bool> source)
         {
             Trace("> connect", "async");
-            var socket = new Socket(AddressFamily.InterNetwork, 
SocketType.Stream, ProtocolType.Tcp);
+            socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, 
ProtocolType.Tcp);
             socket.NoDelay = true;
             socket.SendTimeout = this.ioTimeout;
             var args = new SocketAsyncEventArgs {
@@ -305,7 +307,6 @@
                 switch (args.SocketError)
                 {
                     case SocketError.Success:
-                        this.socket = args.ConnectSocket;
                         var readArgs = new SocketAsyncEventArgs();
                         readArgs.Completed += this.AsyncReadCompleted;
                         readArgs.SetBuffer(buffer, 0, buffer.Length);





Original issue reported on code.google.com by [email protected] on 12 May 2013 at 1:15

Blocking List Pop seems to swallow some messages

What steps will reproduce the problem?
1. set up a 'reader' application to dump messages from the list. See: 
https://gist.github.com/3031281
2. add items to the list (eg using redis CLI or whatever)
3. if you add items before it times out, the 'reader' should pick them up ok. 
if you add after it times out, it *usually* seems to swallow them.

What is the expected output? What do you see instead?
I expect the item added to the list to always be received and be printed out.

What version of the product are you using? On what operating system?
booksleeve , both from nuget and latest from hg

Please provide any additional information below.
if the pop operation times out (which it seems to, even though the timeout 
parameter is set to zero), *most of the time*, the messages will start getting 
swallowed.

I tried tracing it through the debugger and the message is definitely received 
through the 'ReadSingleResult' however I had a hard time determining where it 
was going versus where it should be going after that

Original issue reported on code.google.com by [email protected] on 2 Jul 2012 at 5:41

SDIFF command not available

What steps will reproduce the problem?
1. Try and execte a SDIFF (Set Difference) command


What is the expected output? What do you see instead?
Expected output would be a Task<byte[][]> or similar containing the elements 
present in one set but not the other. Instead I don't see any functions 
available that would allow me to execute this.


What version of the product are you using? On what operating system?
1.0 from NuGet, Windows 7, .NET 4.

Original issue reported on code.google.com by [email protected] on 8 Aug 2011 at 3:24

ZINTERSTORE

Hi,

i'm implementing your library which seems very nice at first look. But for my 
project, I need to have the ZINTERSTORE feature for SortedSets. Do you plan to 
add it soon ? Or have I missed it ?

Thanks in advance,
Guillaume

Original issue reported on code.google.com by [email protected] on 10 Jan 2012 at 3:35

ISortedSetCommands.Score() fails when redis returns <nil>

What steps will reproduce the problem?
1.Try to run the ISortedSetCommands.Score() against either a nonexistent key or 
nonexistent member.

What is the expected output? What do you see instead?
I expect some kind of representation for nil when no score is returned. 
Instead, I get a null reference (value cannot be null) exception at 
   at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
   at System.Double.Parse(String s, IFormatProvider provider)
   at BookSleeve.MessageResult`1.Complete(RedisResult result) in c:\BuildAgent\work\4fa0cfb72d79d4c0\BookSleeve\MessageResult.cs:line 33.

What version of the product are you using? On what operating system?
latest, Windows 7

Please provide any additional information below.

Maybe this should return a "double?"? or maybe it should follow the xmldoc 
comment and return a string (/// <returns>the score of member (a double 
precision floating point number), represented as string.</returns>)

Original issue reported on code.google.com by [email protected] on 30 Aug 2012 at 10:32

Missing SortedSet functionality

Any plans to add support for multiple score\value pairs in SortedSets.Add?

Original issue reported on code.google.com by eyalpost on 6 Nov 2012 at 3:26

Closing socket with less exception, less verbose

What steps will reproduce the problem?
1. Create a RedisSubscriberConnection instance.
2. Open and Subscribe.
3. Dispose connection after a wlhile.

What is the expected output? What do you see instead?
No exception occurs in normal execution.
ObjectDisposedException or NullReferenceException occurs within 
RedisConnectionBase.OnDispose, one of those lines:

socket.Shutdown(SocketShutdown.Both);
socket.Close();
socket.Dispose();

Of cource, your code catches all exceptions but we don't expect any throw if 
possible.

What version of the product are you using? On what operating system?
1.3.38 and 1.3.39 in Windows 7/Windows Server 2008 R2

Please provide any additional information below.

This is obvious multithread problem.
Don't nullify field after check. Check after nullify and then proceed disposal 
invocations. Better code is:

var socket = Interlocked.Exchange(this.socket, null);
if (socket != null)
{
try
{
Trace("dispose", "closing sockrt...");
socket.Shutdown(SocketShutdown.Both);
socket.Close();
socket.Dispose();
Trace("dispose", "closed socket");
}
catch (Exception ex)
{
Trace("dispose", ex.Message);
}
}

Original issue reported on code.google.com by [email protected] on 15 Oct 2013 at 3:35

Add TIME command

What steps will reproduce the problem?
1. Try to get the timestamp from the redis server (TIME command, see 
http://redis.io/commands/time)

What is the expected output? What do you see instead?
There is no support, ability to call this command.

What version of the product are you using? On what operating system?
HEAD

Please provide any additional information below.
See attached .patch file, very easy to add.

Original issue reported on code.google.com by [email protected] on 20 Mar 2013 at 1:20

Attachments:

Changes to the API

I realize this may be a problem to implement (breaking changes etc.), but I 
really hate the fact that all the Redis methods contain the following 2 
parameters:
int db, and bool queueJump
It would be nice if those parameters worked the way transactions are working 
now, these would be methods of the Connection object which would return an 
object which supports the same API. e.g.:

Connection.SelectDb(0).Hashes.Get(/*no need for int DB here*/,...)
or
Connection.SelectDb(0).QueueJump.Get(..);

This will allow to remove those 2 parameter across the API (making it much 
cleaner) and will also allow to cache the object returned from SelectDb for 
reuse (most apps don't change DB during execution)

Original issue reported on code.google.com by eyalpost on 29 Oct 2012 at 8:35

Documentation

This library deserves documentation. 

For example I'm currently reading code to understand when Close, Shutdown and 
Error events are fired from connection.

Also, move to github would help this project get more contributions.

Original issue reported on code.google.com by [email protected] on 15 Aug 2013 at 9:40

ConnectionUtils sample?

Is there a sample of how to use ConnectionUtils?

Also will this handle a failure if one Redis instance goes down?

Original issue reported on code.google.com by [email protected] on 29 Nov 2012 at 11:20

Unable to find assembly 'BookSleeve, Version=1.1.0.7, Culture=neutral, PublicKeyToken=null' error in Application Logs during performance

What steps will reproduce the problem?

Using redis with ASP.NET MVC 3 and .NET 4. During load test see the following 
error:

Log Name:      Application
Source:        ASP.NET 4.0.30319.0
Date:          7/27/2012 10:11:53 AM
Event ID:      1325
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      SERVER-13
Description:
An unhandled exception occurred and the process was terminated.

Application ID: DefaultDomain

Process ID: 2152

Exception: System.Runtime.Serialization.SerializationException

Message: Unable to find assembly 'BookSleeve, Version=1.1.0.7, Culture=neutral, 
PublicKeyToken=null'.

StackTrace:    at 
System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
   at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.AppDomain.Deserialize(Byte[] blob)
   at System.AppDomain.UnmarshalObject(Byte[] blob)
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="ASP.NET 4.0.30319.0" />
    <EventID Qualifiers="49152">1325</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2012-07-27T10:11:53.000000000Z" />
    <EventRecordID>3052</EventRecordID>
    <Channel>Application</Channel>
    <Computer>AMAZONA-0P89F09</Computer>
    <Security />
  </System>
  <EventData>
    <Data>An unhandled exception occurred and the process was terminated.

Application ID: DefaultDomain

Process ID: 2152

Exception: System.Runtime.Serialization.SerializationException

Message: Unable to find assembly 'BookSleeve, Version=1.1.0.7, Culture=neutral, 
PublicKeyToken=null'.

StackTrace:    at 
System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
   at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.AppDomain.Deserialize(Byte[] blob)
   at System.AppDomain.UnmarshalObject(Byte[] blob)</Data>
  </EventData>
</Event>




What version of the product are you using? On what operating system?

1.1.0.7 on Windows Server 2008



Original issue reported on code.google.com by [email protected] on 27 Jul 2012 at 12:20

Client API crashes when redis server is killed

What steps will reproduce the problem?
1. Start redis server
2. Open connection using RedisConnection class
3. Kill redis server

What is the expected output? What do you see instead?

Expect client application to raise Closed event and not crash.

What version of the product are you using? On what operating system?

Application crashes due to unhandled SocketException/IOException and subsequent 
Debugger.Break.

Please provide any additional information below.

Fixed by handling SocketException and IOException in addition to 
ObjectDisposedException and NullReferenceException, in 
RedisConnectionBase.ReadReplyHeader. Is this a valid workaround, if so can we 
get it added?

Many thanks for the great API!

Original issue reported on code.google.com by [email protected] on 5 Aug 2011 at 5:06

Rank method of SortedSet

What steps will reproduce the problem?
- Use Rank method of ISortedSet with ascending = false

What is the expected output? What do you see instead?
- Rank of member in the sorted set stored at key, with the scores ordered from 
high to low.

Please provide any additional information below.
Fix: 
http://code.google.com/r/globchastyy-booksleeve/source/detail?r=b041003775e6bbe3
0988cef4512625076dbc95c5

Original issue reported on code.google.com by [email protected] on 9 Jan 2012 at 7:08

SORT command missing

What steps will reproduce the problem?
1. Try to use http://redis.io/commands/sort

What is the expected output? What do you see instead?

 There doesn't seem to be a way to issue that command at all.

What version of the product are you using? On what operating system?

 Trunk as of this writing

Please provide any additional information below.

 I tried to use SORT BY foo GET ... but found no way to do that w/ BookSleeve. Quickly glancing at the source reveals a definition of the SORT command in an enum, but it seems to be unused elsewhere?

Support for SORT would make basic relational things (get me the first N items 
of this sorted set but look up the following keys as well) map to redis in a 
better way.

Original issue reported on code.google.com by [email protected] on 13 Nov 2011 at 1:25

Throw exception if connection not open

What steps will reproduce the problem?
1. Make a new RedisConnection
2. Make any sort of call without calling Open first

What is the expected output? What do you see instead?
Expected output would be a nice exception saying "Open the connection first!". 
Instead a timeout occurs, so you end up spending half an hour debugging your 
server and checking your keys etc.

What version of the product are you using? On what operating system?
1.1.0.5, Windows 7 x64

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 2 Apr 2012 at 4:12

Client stucks forever if connection to Redis is dropped while there are a few unsent messages.

What steps will reproduce the problem?
1. Start Redis and an application that sends simultaneously a bunch of commands 
to Redis throught Booksleeve client.
2. Set a breakpoint within RedisConnectionBase.Outgoing method on the line 
marked below

while (unsent.TryDequeue(false, out next, out isHigh))
{
here>    if (abort)

3. Do some activities with the test application which requires some access to 
Redis. The program should be paused on the breakpoint.

4. Now shutdown Redis server. And release the debugger so that the program can 
continue executing. And you will see it stucks forever.

What is the expected output? What do you see instead?
n/a

What version of the product are you using? On what operating system?
Booksleeve 0.9 on Windows 2008 Server R2 64bit

Please provide any additional information below.
Actually the steps to reproduce doesn't explain the problem but I hope 
it is clear enough in which situations this problem may occur. In other words 
this problem is quite difficult to reproduce whithout debugger as the chance 
that Redis goes down (or the network drop occurs) at the very moment there are 
still a few unsent messages in a queue is too small.

So the idea is simple if the connection is dropped while a message is processed 
in method 'Outgoing' it ends with exception so if there are still a few 
messages in the 'unsent' queue they will not be aborted by the following lines 
of codes (as it was expected by doing 'abort = true' in method 'Dispose', AFAIU 
it was the idea where the mistake resides) as the 'Outgoing' method already ends

if (abort)
{
   CompleteMessage(next, RedisResult.Error("The system aborted before this message was sent"));
   continue;
}

So those messages from the 'unsent' queue will never complete. It means the 
tasks related to them will also never complete.

I've attached my version of booksleeve client (be aware that it contains not 
only fix for this issue, but also implementation for a few Redis commands that 
were not originally supported by Booksleeve. Sorry about that I actually have 
no time to separate changes that belongs to this fix only). Fix for this issue 
affects files RedisConnection.cs and RedisConnectionBase.cs only. And BTW I 
can't attach the test application as it is part of our product.

With the 'sent' queue everything is not so bad as on connection drop the 
exception will be thown in method 'ReadReplyHeader' on the line where 'EndRead' 
is called and it will force method 'Shutdown' to be called. The last one 
completes all the messages from queue 'sent'. But in my version Shutdown method 
is also called from method 'Outgoing' in case of exception is thrown just to 
make us safe if such kind of error occurs within method 'Outgoing' that doesn't 
make 'EndRead' to fail.

Original issue reported on code.google.com by [email protected] on 30 Jun 2011 at 1:39

Attachments:

ISortedSetCommands.RangeString throw NotImplementedException

What steps will reproduce the problem?
1. Invoke RangeString with any arguments

What is the expected output? What do you see instead?
The data to be returned as strings.  Throws NotImplementedException.

What version of the product are you using? On what operating system?
1.1.0.5

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 9 Apr 2012 at 12:46

Redis command: Client List

Is there any reason that the client list command 
(http://redis.io/commands/client-list) is not implemented?
I need it in order to identify slaves in run time (by grepping flags=S).
I think it also might be useful in the ConnectionUtils you've added 
(http://code.google.com/p/booksleeve/source/browse/BookSleeve/ConnectionUtils.cs
). Use it instead of receiving all slaves configurations.

What is the expected output? What do you see instead?
public Task<string> GetClientList()


What version of the product are you using? On what operating system?
Booksleeve v1.1.05 with Redis server v2.4.15 on Ubuntu 12.04

Original issue reported on code.google.com by [email protected] on 6 Aug 2012 at 8:02

Redis INFO command results output has changed (comments and empty lines added in 2.6 unstable)

Redis INFO command output has changed (in 2.6: not every result line is data, 
comments and spaces have been added). 

At connect time Booksleeve checks for redis_version and therefore executes 
redis INFO command that is parsed using ParseInfo.

Solution:
In BookSleeve.RedisConnectionBase in ParseInfo() at around line 238 we have to 
check that we have real INFO data and not comment or empty line.. Every useful 
result has ":" in it.

change from:
  int idx = line.IndexOf(':');
  data.Add(line.Substring(0, idx), line.Substring(idx + 1));

to:
  int idx = line.IndexOf(':');
  if (idx > 0)    //added, since redis 2.6 has commented INFO with groups that start with hash for example: # Clients,... #Stats...
  {
      data.Add(line.Substring(0, idx), line.Substring(idx + 1));
  }



Details of problem (analysis of INFO output format changes):

#OLD REDIS INFO FORMAT (used in 2.4)
redis 127.0.0.1:6379> info
redis_version:2.4.6
redis_git_sha1:00000000
redis_git_dirty:0
arch_bits:64
multiplexing_api:epoll
gcc_version:4.4.3
process_id:1995
uptime_in_seconds:116813
uptime_in_days:1
lru_clock:810806
used_cpu_sys:13.16
used_cpu_user:8.88
used_cpu_sys_children:0.12
used_cpu_user_children:0.28
connected_clients:9
connected_slaves:0
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0
used_memory:807784
used_memory_human:788.85K
used_memory_rss:1159168
used_memory_peak:807888
used_memory_peak_human:788.95K
mem_fragmentation_ratio:1.43
mem_allocator:jemalloc-2.2.5
loading:0
aof_enabled:0
changes_since_last_save:12
bgsave_in_progress:0
last_save_time:1329313804
bgrewriteaof_in_progress:0
total_connections_received:11693
total_commands_processed:65180
expired_keys:0
evicted_keys:0
keyspace_hits:53487
keyspace_misses:5
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:263
vm_enabled:0
role:master
db0:keys=4,expires=0
db4:keys=1,expires=0





#NEW REDIS INFO FORMAT (used in 2.6)
redis 127.0.0.1:6379> info
# Server
redis_version:2.9.3
redis_git_sha1:5e985e79
redis_git_dirty:0
arch_bits:64
multiplexing_api:epoll
gcc_version:4.4.3
process_id:14853
tcp_port:6379
uptime_in_seconds:9416
uptime_in_days:0
lru_clock:810811

# Clients
connected_clients:14
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0

# Memory
used_memory:1395536
used_memory_human:1.33M
used_memory_rss:2412544
used_memory_peak:1415832
used_memory_peak_human:1.35M
used_memory_lua:24576
mem_fragmentation_ratio:1.73
mem_allocator:jemalloc-2.2.5

# Persistence
loading:0
aof_enabled:0
changes_since_last_save:0
bgsave_in_progress:0
last_save_time:1329313812
bgrewriteaof_in_progress:0

# Stats
total_connections_received:2767
total_commands_processed:32715
rejected_connections:0
expired_keys:0
evicted_keys:0
keyspace_hits:244
keyspace_misses:544
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:244

# Replication
role:slave
master_host:192.168.1.52
master_port:6379
master_link_status:up
master_last_io_seconds_ago:1
master_sync_in_progress:0
connected_slaves:0

# CPU
used_cpu_sys:0.76
used_cpu_user:0.95
used_cpu_sys_children:0.00
used_cpu_user_children:0.31

# Cluster
cluster_enabled:0

# Keyspace
db0:keys=236,expires=0

---------------------------------------------

Original issue reported on code.google.com by [email protected] on 15 Feb 2012 at 2:16

Feature Request: IHashCommands.Set

It would be useful if the IHashCommands.Set method was overloaded to accept an 
IDictionary<string, string> property. A lot of the methods on RedisConnection 
have overloads for string and byte[] but this one is missing.

Also, the existing Set() method would be more useful if you passed in 
IDictionary rather than the concrete Dictionary type. We use 
ConcurrentDictionary a lot in multi-thread apps, which Booksleeve currently 
doesn't play nice with.

Thus, these two methods would be supported on IHashCommands:

IHashCommands.Set(int db, string key, IDictionary<string, string> values, bool 
queueJump = false)

IHashCommands.Set(int db, string key, IDictionary<string, byte[]> values, bool 
queueJump = false)


Dan..

Original issue reported on code.google.com by [email protected] on 15 Jan 2013 at 1:02

Sentinel API

Are you planning to implement the sentinel API commands?
We would like to take advantage of the "SENTINEL masters" and "SENTINEL 
is-master-down-by-addr" commands for discovery of nodes etc.

Original issue reported on code.google.com by eyalpost on 1 May 2013 at 8:02

Transaction conditions are true but transaction fails

Hi,

I've noticed that sometimes, when running a lot of conditional transactions, 
the output of the Execute() method return false, but none of the conditions 
evaluate to false.

This only happens once in about 100 transactions, so it's difficult to 
reproduce it.
The issue only occurs when the transaction has multiple conditions (the more 
the better).

This is the code I used:

//Create a whole bunch of keys...

for(int i = 0; i < 1000; i++)
{
       using(var tx = conn.CreateTransaction())
       {
              var cond1 = tx.AddCondition(Condition.KeyExists(0, "anExistingKey1");
              var cond2 = tx.AddCondition(Condition.KeyExists(0, "anExistingKey2");
              var cond3 = tx.AddCondition(Condition.KeyExists(0, "anExistingKey3");

              tx.Eval(...);

              var txRes = tx.Execute();

              Assert.IsTrue(cond1);  //--> ok
              Assert.IsTrue(cond2);  //--> ok
              Assert.IsTrue(cond3);  //--> ok
              Assert.IsTrue(txRes);   //--> not ok: false
       }
}

I had a look at the method "MultiMessage.ExecutePreconditions". It looks like 
only the result of the last condition's task is waited for. If that one returns 
false, the transaction fails and "unwatch" is called.

When I change the code to wait for the result of all condition's tasks 
(Task.WaitAll), it works fine.

Is there any guarantee that the last condition sent will contains the first 
task that finishes? It seems to me that there's no way to be sure the 
TaskScheduler finishes that task first.

Am I doing something wrong here?

Gert

Original issue reported on code.google.com by [email protected] on 26 Apr 2013 at 1:12

EVAL with error inside transaction doesn't throw exception

Hi,

I've encountered an issue when executing a script inside a transaction.
When the script return an error (redis.error_reply), the transaction just 
returns "OK" as if nothing went wrong.

What steps will reproduce the problem?

var conn = GetConnection();

bool result;
using(var tx = conn.CreateTransaction())
{
      tx.Scripting.Eval(0, "return redis.error_reply('something went wrong')", new string[0], new object[0]);
      result = conn.Wait(tx.Execute());
}

Assert.IsFalse(result); //--> This one is true

I would expect that the exception is simply rethrown by tx.Execute(). Right 
now, nothing happens and the Execute method return "True".

I've been able to fix the issue by making some simple changes:

1. I've updated class MultiRedisResult. You can find the updated code in the 
attachment.
2. I've made ExecMessage non-critical by removing the call to Critical() in 
it's constructor.

This way, the exception is thrown by the Execute method when the script returns 
an error.

Regards
Gert

Original issue reported on code.google.com by [email protected] on 25 Apr 2013 at 1:53

Attachments:

Incorrect score returned when using SortedSets.Range

What steps will reproduce the problem?
1. Add an item to a sorted set with a score greater than Int32.MaxValue
conn.SortedSets.Add(3, "zset", "abc", DateTime.Now.Ticks);

2. Retreive said item and score using Range
var range = conn.SortedSets.Range(3, "zset", 0, -1);

What is the expected output? What do you see instead?
Expected: 634614442154715759
Actual: -2147483648

What version of the product are you using? On what operating system?
1.1.0.3 on Windows 7, Redis 2.4.5 on Linux

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 5 Jan 2012 at 9:59

Couple of things..

1. SetIfNotExists is missing an overload that takes a string value

2. No hash related commands seem to exist, is there something in the pipeline 
or should I make a start on something?

Thanks :)

Original issue reported on code.google.com by [email protected] on 7 May 2011 at 10:29

Variadic L/RPUSH (AddFirst/AddLast)

What steps will reproduce the problem?
1. Try and use LPUSH or RPUSH (aka AddFirst or AddLast) with a string[] or 
byte[][]

What is the expected output? What do you see instead?
Expect to be able to add many items to a list in one call, instead there is no 
method available.


What version of the product are you using? On what operating system?
1.1.0.1, Windows 7 64bit

Please provide any additional information below.
I can see support available for some other Redis 2.4 variadic commands such as 
SADD and SREM but not LPUSH / RPUSH.

Original issue reported on code.google.com by [email protected] on 12 Dec 2011 at 7:52

Leaked RedisConnection objects after dispose.

What steps will reproduce the problem?
1. Create a RedisConnection to a valid server.
2. Open the connection.
3. Dispose of the connection.
4. Take a memory snapshot with your memory profiler of choice.

What is the expected output? What do you see instead?
I would expect to see the RedisConnection object in the finalization queue. 
Instead there is a lingering SocketAsyncEventArgs preventing the connection 
from being garbage collected.

What version of the product are you using? On what operating system?
v1.3.39

Please provide any additional information below.
The readArgs instance var of RedisConnectionBase is never disposed of. That 
object holds onto a RedisConnection reference via the 
SocketAsyncEventArgs.Completed event delegate.

Fixed via: 
https://code.google.com/r/agcastle64-booksleeve/source/detail?r=5168fee3e1fcedc5
070fdb252b3052b6eeaef247

Original issue reported on code.google.com by [email protected] on 30 Oct 2013 at 2:47

System.TimeoutException

I know this not much of a bug report, but maybe someone can shed some light on 
a problem i'm having.

We have a fairly simple job queueing system build on redis + booksleeve.
It basically loops over the following method and if it doesn't return null, it 
means we have a job and we go run it.

        public static Job Pop(string queue)
        {
            var client = redis();

            var task = client.Lists.RemoveFirstString(Jobs.DB, GetKey("queue:" + queue)).ContinueWith(x =>
            {
                if (x.Result != null)
                {
                    var job = LoadJob(x.Result);
                    job.Queue = queue;

                    return job;
                }
                return null;
            });

            task.ContinueWith(x =>
            {
                if (x.Result != null)
                    client.Keys.Remove(Jobs.DB, GetKey("queue:job:" + x.Result.Identitifer));
            });

            return client.Wait(task);
        }

Now we get a System.TimeoutException on the last line. Strange thing is, this 
only happens in our production environment and not our development and test 
environments.

We're running Redis 2.9.7 in all of our environments.

The timeoutexception gets thrown maybe once every 5 or so calls.
Anyone have an idea what could be wrong here?

Original issue reported on code.google.com by [email protected] on 8 Nov 2012 at 3:53

RedisSubscriberConnection always in Opening ConnectionState

What steps will reproduce the problem?
1. Create instance of RedisSubscriberConnection(serverIP)
2. Open() subscriber connection
3. (Optional) Subscribe to channels and receive published messages
4. Check Subscriber Connection state it is always "Opening"

What is the expected output? What do you see instead?
I would expect that the connection state would change to "Open" once the 
connection was opened successfully, just as RedisConnection does. The Redis 
Subscriber Connection is initialized as "Shiny" when it is instantiated, then 
changes to "Opening" when Open() is called, yet it never changes to "Open", 
even if server communication is working perfectly.

What version of the product are you using? On what operating system?
Booksleeve: 1.2.0.8 (NuGet)
Redis: 2.4.18 AND 2.6.10




Original issue reported on code.google.com by Reece.Sean on 5 Mar 2013 at 2:18

Redis command: EVAL/EVALSHA

I'd like to propose to add following redis command: EVAL - EVALSHA (LUA 
Scripting) as defined in http://www.redis.io/commands/eval

This redis command is supported from version 2.2.106 as experimental and will 
be fully integrated in redis 2.6.0. Redis 2.6 RC1 is planned for end of 
2011.Redis 2.4 as branch does not support EVAL/EVALSHA. Source: 
http://antirez.com/post/short-term-redis-plans.html. 

At the moment we use alternative c# library, however we would like to move to 
full async IO, since we have high-performance requirements for our app. At the 
moment we use following functions from alternative library (we have 3 types of 
results that we receive (string, long, List<string>):

public string GetEvalStr(string body, int numOfArgs, params string[] args)
public long GetEvalLong(string body, int numOfArgs, params string[] args)
public List<string> GetEvalMultiData(string body, int numOfArgs, params 
string[] args)

public string GetEvalSha1Str(string body, int numOfArgs, params string[] args)
public long GetEvalSha1Long(string body, int numOfArgs, params string[] args)
public List<string> GetEvalSha1MultiData(string body, int numOfArgs, params 
string[] args)

What is the expected output? What do you see instead?
I believe that whole EVAL scripting is not supported. We suggest to add 
EVAL/EVALSHA1 commands.

What version of the product are you using? On what operating system?
Latest library from 2011-12-27 / Redis 2.2.106 (must have scripting support !). 
Client: WIN7 /NET 4.0, REDIS server on Ubuntu 10.04.

Original issue reported on code.google.com by [email protected] on 27 Dec 2011 at 10:35

Connection closes when -ERR received from server during open.

What steps will reproduce the problem?
1. Disable INFO or CONFIG command on server
2. Open a connection
3. Connection will be closed when -ERR unknown command response is received 
from server to the INFO or CONFIG commands sent during the open.

What is the expected output? What do you see instead?
I'd expect the connection to stay open.  The error in this case doesn't seem to 
matter.  Commands that are sent after the open has completed but before the 
unknown command response is received work correctly.

What version of the product are you using? On what operating system?
1.1.0.5

Please provide any additional information below.
I have no control over the server I connect to.  It's a slave off the master 
server and all commands considered to be unnecessary have been disabled on the 
slave.

Within Booksleeve the error response is detected and the isFatal flag set to 
false (RedisConnectionBase.cs line 385) but the connection is closed anyway in 
the catch block at line 264.  I've modified the code to get it working but I'm 
not a C# native so it would be better if an expert did that.

Original issue reported on code.google.com by [email protected] on 28 Feb 2013 at 11:17

how to connect booksleeve through http proxy?

Is it possible to connect booksleeve to redis server through http proxy? 
Because our clients' environment are using http proxy either with default 
authentication or custom authentication.

I've tried to google booksleeve proxy / booksleeve http proxy with no result, 
please help me.

thank you,
khonato

Original issue reported on code.google.com by [email protected] on 13 Mar 2013 at 7:57

Blocked connect within thread pool

What steps will reproduce the problem?
1. If you open enough many number connection, Windows thread pool may not 
consume your job immediately. This is caused if you use TaskFactory.StartNew or 
another thread pool based .NET feature for intensive workload.

What is the expected output? What do you see instead?
I expect to execute RedisConnecionBase.Open as immediate as possible. To fix, 
you may change the code with ConnectAsync()

What version of the product are you using? On what operating system?
1.3.27, on Windows 7

Please provide any additional information below.
https://code.google.com/r/tcaesvk-booksleeve-20130417/source/detail?r=fb8106d360
0cbd616c684d336cb5e1d880ef7c38

Original issue reported on code.google.com by [email protected] on 18 Apr 2013 at 5:48

Logging API

Do you have any plan of append monitoring/profiling/logging API or other way?

I want to get request count, durations, etc.
and finally, integrate with MiniProfiler.

Original issue reported on code.google.com by [email protected] on 18 Apr 2013 at 7:32

Missing LTRIM comù

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 6 Jun 2011 at 4:11

Attachments:

Subscribing to multiple channels at once will cause an Exception

What steps will reproduce the problem?
1. Subscribe with more than one channel as the first argument
2. Redis will reply with one message per requested channel

What is the expected output? What do you see instead?

The second reply from Redis will cause the exception 'Data received with no 
matching message' since Booksleeve only expects a single reply for the 
subscribe message.

In addition, the task returned by Subscribe() should only be finished after 
Booksleeve received a reply for all the initially requested channels.

What version of the product are you using? On what operating system?
1.3.9

Original issue reported on code.google.com by [email protected] on 24 Mar 2013 at 8:29

Incrementing a new field in a hash doesn't return '1'

var number= await Redis.Hashes.Increment(db, "key:, <int>);

The above line of code will return the new number stored in the field in that 
hash. If the field already exists this works just fine, but if it is a new 
field nothing is ever returned to the caller. I have hooked into the 
TaskScheduler.UnobservedException and no error is ever caught.

To clarify the data IS stored in redis just fine but control is never given 
back to me.

The documentation for Hashes.Increment says "If the field does not exists...the 
value will be set to zero before the operation"

In this scenario I would also except the method to return 1 since that would be 
the value.

Original issue reported on code.google.com by [email protected] on 20 Nov 2012 at 4:35

Should Set()/Get() with byte[] be deprecated?

Set()/Get() variants with byte[] value have been deprecated, yet they're still 
useful for storing binary blobs or serialized objects. Or am I missing a newer 
API that supports this?

Original issue reported on code.google.com by [email protected] on 9 Oct 2013 at 5:26

Strange behavior using CancellationToken with Task.Wait

What steps will reproduce the problem?
1. Using a connection, perform a blocking BLPOP with no time out (empty list to 
begin with)
2. Wait on this task using task.Wait(cancelToken)
3. Signal the Cancellation Token to Cancel() so that the task.Wait returns
4. Insert something into the list
5. Run the BLPOP command again, this time with a 1 second timeout
6. Notice via Redis MONITOR that the BLPOP was executed
7. Notice the returned result from Step 5 is empty/nothing
8. Notice that the list has been emptied (the item was popped off the list)
9. The popped item has been lost

What is the expected output? What do you see instead?
I would have expected the second BLPOP command to succeed.

I can understand that perhaps because the first BLPOP (that was cancelled) is 
still actually in-progress (and you can't cancel a Redis command this way?) 
that this is not going to work properly.

What version of the product are you using? On what operating system?
redis 2.6.8-pre2 (Windows)
Booksleeve 1.3.12

Please provide any additional information below.
Ideally I want this feature to work so I can block forever, or until my calling 
code decides it doesn't want to be blocking anymore (eg, give up), as opposed 
to using a pre-set timeout.

If this is not possible using cancellation tokens, perhaps Booksleeve should 
raise an error to indicate this is impossible, instead of this strange behavior.

Cheers


Original issue reported on code.google.com by [email protected] on 3 Apr 2013 at 12:28

ISortedSetCommands API confusion

What steps will reproduce the problem?
1. Attempt to discern which Range() overload is by rank vs. score


What is the expected output? What do you see instead?
Expect to be able to easily tell the two calls appart, instead they are 
identical method signatures only differing in that one takes doubles and one 
takes longs.

What version of the product are you using? On what operating system?
1.1.0.5

Please provide any additional information below.
Have you considered more explicitly named RangeByRank() and RangeByScore() or 
possibly Range() and RangeByScore() to better match the native Redis API?

Original issue reported on code.google.com by [email protected] on 9 Apr 2012 at 12:49

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.