sodonnel commented on PR #10109: URL: https://github.com/apache/ozone/pull/10109#issuecomment-4378583519
> Generally we should choose the one with less complexity, and less cost. If replacing the fields inline, there are at least 4 fields' swaps, one by one. If replacing the container reference, there is one swap. Basically, hot swap one pointer has less complex result than hot swap four pointers, right? I don't think updating fields in an object, which can be done atomically under an existing lock is complex. Swapping the object for another is simple, but look at this bug it causes and the fix which is bleeding out into lots of code areas. And even after this fix, if someone adds a new service, they have to know they need to do these strange things (get a container, then get it again and check it hasn't changed) to avoid a race condition they shouldn't really be concerned about. If we fix this at source, by locking the container object, updating the fields atomically and unlocking, then its fixed once and for all in a single place -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
