fix: ensure setting/getting additional attributes is concurrency safe#66
fix: ensure setting/getting additional attributes is concurrency safe#66techfg wants to merge 1 commit intogo-chi:masterfrom
Conversation
VojtechVitek
left a comment
There was a problem hiding this comment.
Thanks for raising #65!
While this looks good and solves the report. Can we think about a solution without using any extra locks?
|
Thanks for taking a look at this @VojtechVitek! Here are some ideas but it really comes down to what the use cases are which you'd likely know better than I, however I can draw some assumptions since the patterns would be pretty standard:
Those are just some ideas off the cuff but open to any that you have 😄 My vote would be to add locking, either Question - Other than what should be a very negligible performance impact (e.g., 10-100ns w/ a slight CPU & memory hit) which I do understand would be ideal to avoid entirely, can you expand on your reasons for not wanting to introduce locking? |
I thought of a 4th option that might be a good compromise....
This really is a variant of option 3 but doesn't increase code maintenance cost as much and leverages all the existing types that already exist. I'm in favor of this option vs. the other options I listed as I think it's the best compromise to what I suspect are your concerns around locking, although still curious to confirm what your reservations are along that line, if any, beyond performance :) Look forward to your thoughts, thank you! |
Ensures that reading/writing to log attributes is concurrency safe.
Resolves #65