Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpp: locking of value/meta-data does not give exceptions #3170

Open
markus2330 opened this issue Nov 7, 2019 · 5 comments

Comments

@markus2330
Copy link
Contributor

@markus2330 markus2330 commented Nov 7, 2019

As reported by @manuelm:

k = kdb.Key("user/foo", {"meta":"some"}); k.lockMeta(); k.getMeta("meta").value="changed"; print(k.getMeta("meta").value) => some

k = kdb.Key("user/foo", "value"); k.lockValue(); k.value="changed"; print(k.value) => value

As it is only an internal API and is currently not needed, I made it low priority.

@kodebach

This comment has been minimized.

Copy link
Contributor

@kodebach kodebach commented Nov 7, 2019

The behaviour described above is exactly what I expect from the locking mechanism. The values aren't changed. Is the description the current state or the expected state? The description says "as reported" so I assume it is the current state, but in that case what is the problem here?

@manuelm

This comment has been minimized.

Copy link
Contributor

@manuelm manuelm commented Nov 7, 2019

Seems @markus2330 didn't quite understand what I was trying to say. He also omitted my sarcastic question: Elektra/CPP has support for invisible errors?

What I'm trying do say is that the CPP bindings don't throw exceptions (apart from the name lock).

@markus2330 markus2330 changed the title locking of value/meta-data does not work cpp: locking of value/meta-data does not give exceptions Nov 7, 2019
@markus2330

This comment has been minimized.

Copy link
Contributor Author

@markus2330 markus2330 commented Nov 7, 2019

Sorry, for the confusion, I updated the title. I only copied it from an discussion that we do not forget about it.

@manuelm can you take the issue, afaik you already have it fixed anyway?

@manuelm

This comment has been minimized.

Copy link
Contributor

@manuelm manuelm commented Nov 7, 2019

erm no. Nothing got fixed on my side.

I can try to add exceptions to all key modifying functions. But I won't add tests to cpp nor update any failing plugins or tools. Regardless of the exceptions the python bindings still need a way to check if the name has been locked.

@markus2330

This comment has been minimized.

Copy link
Contributor Author

@markus2330 markus2330 commented Nov 8, 2019

I can try to add exceptions to all key modifying functions.

Thank you, that would be amazing. It would be more consistent as the setters for names already throw.

But I won't add tests to cpp nor update any failing plugins or tools.

Adding tests should not be necessary, as you only add one if per function.

But getting everything working again would be needed, hopefully it will be enough to simply remove some failing tests: Usually error paths are untested anyway, so maybe the changes will be very little.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.