threefoldtecharchive / bcdb

Apache License 2.0
1 stars 0 forks source link

multiple concurrent insertions to bcdb fail #66

Closed Hamdy closed 4 years ago

Hamdy commented 4 years ago

the following code in crystal lang fails with the errro {"code":500,"message":"failed to insert data to index"}

code:

    client = Bcdb::Client.new unixsocket: "/tmp/bcdb.sock", db: "db", namespace: "example" 
    10.times do |i|
      spawn do
        random_tag = "#{UUID.random.to_s}"
        tags = {"example" => random_tag, "tag2" => "v2"}
        key = client.put("a", tags)
        pp! "#{i} - #{key}"
      end
    end
Hamdy commented 4 years ago

fixed!