-
Notifications
You must be signed in to change notification settings - Fork 440
TEZ-4350: Remove synchronized from DAGAppMaster.serviceInit #162
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
Conversation
|
💔 -1 overall
This message was automatically generated. |
|
@abstractdog, the findbugs above is showing the inconsistent synchronization. I am trying to imagine scenarios where the synchronization is needed, but let me describe generally what could happen. In multi-threaded apps, assignments are lazy and in a busy time, java may choose not to immediately propagate value change or assignment across to all threads. Then Other threads accessing will find an outdated value or old or unassigned object. So it's always safer to synchronize all accesses. However, it's rare to have an "init" or initial object assignment not get propagated to all other threads. My knowledge about this might be a little bit incorrect, so correct me if I'm wrong. The question to me is really, what is the cost of having the synchronization there? My guess would be a millisecond max, which in the grand scheme of things, isn't much. Do have think this change will have a bigger impact? |
|
let me give the background of this change: it was created exactly because of the same inconsistent sync alerts in TEZ-4347 (which I'm about to finish soon too), just because in TEZ-4347 I was accessing some fields, that I don't really worried about from synchronization point of view, e.g. webUIService (alert is here), but it's accessed from serviceInit too, which doesn't need to be synchronized according to comments this means two ways to solve this: [1] doesn't make sense to me, as serviceInit itself is not supposed to be synchronized so my point is, the goal here is not performance, but going for [2] instead of [1] |
|
double-checked: AbstractService lifecycle methods are guarded with a lock since YARN-530 (which introduced a strict and robust lifecycle) YARN-530 + MAPREDUCE-5298 introduced similar changes to MrAppMaster |
|
💔 -1 overall
This message was automatically generated. |
jteagles
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. Reran Tez QA bot to verify findbugs results.
No description provided.