-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Minor Response Packet Handler cleanup #4430
Minor Response Packet Handler cleanup #4430
Conversation
… name confusing since we already have ResponseHandler for different purpose. BasicOperationScheduler is now explicitly making use of Packet; code was too generic for no reason.
👍 |
My comments are not related to this pr but rather more general concern. This ResponseThread seems awkward. Its process method is called directly. The thread itself waiting on a workingQueue that nobody putting anything into. It seems that packet deserialization is done in IO thread. Are we ok with these? |
Hi Sancar. I don't think that the the case. The IO thread takes a packet of the wire, checks if response+operation bit are set, and puts it on the queue of the response-thread. Then the response-thread takes it of the queue, deserializes it and then processes it. So the IO thread is not doing any heavy lifting. |
PS: I'm still working on getting rid of the response thread. I have made several attempts but tilll so far have not been able to improve performance. |
Yes, the scenario that you mentioned what should have been. But I am afraid it is not the case. Just take a close look of workQueue of ResponseThread. I checked usages of workqueue, there is "take" method called on it, but nothing is pushing into it. |
|
Yes, the process is directly called, rather than putting into queue. Isnt that wrong? or am I missing something big? or You need coffee again? |
It is an optimization we have been playing with, but it should never have made it in the master. I see I'm the cause of this change. The only way to get rid of the response queue is to get rid of the response object because they are now being deserialized on the IO thread. |
Good spotting. I'll revert to changes in a different PR and see what the performance implications are. I'll do a bit more investigation what happened. |
@gurbuzali @sancar can you have another look? |
👍 |
…andler Minor Response Packet Handler cleanup
Renamed BacicResponseHandler to BasicPacketResponseHandler to prevent name confusing since we already have ResponseHandler for different purpose.
BasicOperationScheduler ResponseThread is now explicitly making use of Packet; code was too generic for no reason. The queue was for packets, but there was still an unwanted check done for non packets from that queue.