ppconsul icon indicating copy to clipboard operation
ppconsul copied to clipboard

Read value sometimes exists with strange signs at the end of value

Open maxtju opened this issue 3 years ago • 1 comments

I add key-vals by myself (with python script) and checking what was read after the add. For example this pair was created:

INFO:root:Key: confidence_thresh ---> Value: 0.65 (READ: b'0.65')

But when Im reading this value thourgh c++ code:

std::vectorstd::string vKeys = m_pKv->keys(strKeysPrefix); for (auto key : vKeys) { auto kvs = m_pKv->item(key); std::cout << ">>> " << kvs.value << " -> " << kvs.value.size() << " [" << (int)kvs.value.back() - 'a' << "]" << std::endl; }

I receive the following:

0.65� -> 6 [93]

As you can see there is nothing added to the value. Do you have any thoughts what Im doing wrongly ? Thank you & best regards Max

maxtju avatar Feb 09 '22 09:02 maxtju

That’s quite strange.

Are you able to reproduce it with any key/value?

Is it stable (every time you read it is corrupted like this) or flips between correct and corrupted?

What is your OS and compiler? Which version of Consul do you use? Are you using the latest Ppconsul?

oliora avatar Feb 09 '22 22:02 oliora