Enyim client.FlushAll() seems to be causing me problems with the TAP Protocol
Not sure whether this is related to membase or the Enyim client, but any help would be appreciated.
I am writing a C# application using membase for persistence. Using the Enyim library to interact with membase as well as the TAP protocol. For the TAP protocol I am just running tap_example.py and routing its std output to my application.
Basically I am seeing that anytime I call client.FlushAll() my TAP stream stops coming through:
static void Main(string[] args)
{
MembaseClientConfiguration config = new MembaseClientConfiguration();
config.Urls.Add(new Uri("http://localhost:8091/pools/default"));
var client = new MembaseClient(config, "default", "mypassword");
client.Store(StoreMode.Set, "Test1", "A");
client.Store(StoreMode.Set, "Test2", "B");
MembaseTap tap = new MembaseTap(key =>
{
Console.WriteLine(key);
});
tap.Wait();
// client.FlushAll();
The preceding code works fine and prints out the TAP stream results as long as client.FlushAll() is commented out. As soon as I uncomment it, it stops working thereafter, even if I re-comment it out. I am 100% positive that the keys are in the database. One thing worth noting is the MembaseTap is done asynchronously and the anonymous method I pass in occurs for each line of the standard TAP output thats redirected. But overall I don't think that should be a problem. Even if I wait for TAP to finish / time-out before the flush I have this problem.
Also I should mention that the only way I know of to get my TAP stream working again is to restart my computer. It seems like maybe some process is lingering somewhere and causing issues, but I haven't been able to isolate it yet.
IS there any possible relationship between calling client.FlushAll (which I presume calls membase flush commands under the hood?) and disrupting the TAP protocol functionality? The problem doesn't make sense to me so I'd appreciate any input. Thanks!
TAP kind of inverts the protocol handling, so it could be that the client is stuck in that state after the tap commannd is started. I'll. look into documenting this if its the case. Can you try creating a new client object to do the flush?