[
https://issues.apache.org/jira/browse/HBASE-19319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16261693#comment-16261693
]
Appy commented on HBASE-19319:
------------------------------
Two of the three ProcedureEvent functions in ProcedureScheduler don't even use
scheduler in any way - waitEvent and suspendEvent. They only work on event's
internals. There's no reason to put them in scheduler. Moving them to PEvent
class.
On the same lines, am making ProcedureEvent class to be entry point for waking
up events (just like all PEvent related functions).
ProcedureScheduler doesn't "own" events i.e. it doesn't keep track of events,
or manage them, or anything. So we shouldn't put ProcedureEvent "utility"
functions in ProcedureScheduler.
> Fix bug in synchronizing over ProcedureEvent
> --------------------------------------------
>
> Key: HBASE-19319
> URL: https://issues.apache.org/jira/browse/HBASE-19319
> Project: HBase
> Issue Type: Bug
> Reporter: Appy
> Assignee: Appy
>
> Following synchronizes over local variable rather than the original
> ProcedureEvent object. Clearly a bug since this code block won't follow
> exclusion with many of the synchronized methods in ProcedureEvent class.
> {code}
> @Override
> public void wakeEvents(final int count, final ProcedureEvent... events) {
> final boolean traceEnabled = LOG.isTraceEnabled();
> schedLock();
> try {
> int waitingCount = 0;
> for (int i = 0; i < count; ++i) {
> final ProcedureEvent event = events[i];
> synchronized (event) {
> if (!event.isReady()) {
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)