Improve CallQueueManager#swapQueue to make queue elements drop nearly impossible. This is the trade-off between performance and functionality, even in the very very rare situation, we may drop one element, but it is not the end of the world since the client may still recover with timeout.
CallQueueManager may drop elements from the queue sometimes when calling swapQueue.
The following test failure from TestCallQueueManager shown some elements in the queue are dropped.
It looked like the elements in the queue are dropped due to CallQueueManager#swapQueue
Looked at the implementation of CallQueueManager#swapQueue, there is a possibility that the elements in the queue are dropped. If the queue is full, the calling thread for CallQueueManager#put is blocked for long time. It may put the element into the old queue after queue in takeRef is changed by swapQueue, then this element in the old queue will be dropped.