crete-dev icon indicating copy to clipboard operation
crete-dev copied to clipboard

Node is unnecessarily locked during transmission of trace to Dispatch

Open moralismercatus opened this issue 7 years ago • 4 comments

Look at https://github.com/SVL-PSU/crete-dev/blob/71ab5f8f3c6116e1024219d6b93190102c956584/lib/include/crete/cluster/node_driver.h#L302:L323

Notice that lock's mutex is released upon function scope exit. It is held during transmission of the trace. I don't believe this is necessary. Rather, I believe:

 auto lock = node.acquire();
 auto trace = lock->pop_trace();

Should be:

 auto trace = node.acquire()->pop_trace();

Thus node is immediately released upon completion of the statement.

moralismercatus avatar Sep 26 '17 23:09 moralismercatus

@moralismercatus This change was introduced at commit https://github.com/SVL-PSU/crete-dev/commit/9d5e8acb6de068a3b0cf78faf5f19f480cd2c8dc for fixing issue #6. Please let me know your thoughts.

likebreath avatar Sep 27 '17 01:09 likebreath

@likebreath I vaguely remember issue #6 now. I understand the reasoning behind the change. I only happened upon it again while reviewing the flows for other slowdowns.

I'm not sure how pressing an issue this is presently, but, in general, I think a better solution is in order. Especially for very large traces that take a considerable time to archive and transmit, the whole VM node essentially sits idly by and waits for the transmission to complete.

moralismercatus avatar Sep 28 '17 17:09 moralismercatus

I'm not sure how pressing an issue this is presently, but, in general, I think a better solution is in order. Especially for very large traces that take a considerable time to archive and transmit, the whole VM node essentially sits idly by and waits for the transmission to complete.

Totally agree. I think it will be a major slow down when the trace size is large. You may want to look at the patch I did for issue #32 to alleviate the slowdown when trace size is large.

We need to have a patch to fix the slowdown without re-introducing the crash in issue #6.

likebreath avatar Sep 28 '17 18:09 likebreath

Thanks for the reminder on these issues. I'll ponder these issues and see if I can't come up with a PR or two.

moralismercatus avatar Oct 03 '17 19:10 moralismercatus