This improves the pre-flight waitForIdentified() logic
in the tchannel.Request class.
Here we will actually do a check to see if we have
a usable connection and skip the waiting.
If we have to wait because there are zero connections
we also allocate a RequestOperation with a properly
configured timeout and add it to the timeHeap.
This means that the request will timeout within it's
specified timeout irregardless of what the connection
initTimeout value is.
We clean up and cancel the timeout once a connection
is identified and available
This improves the pre-flight waitForIdentified() logic in the tchannel.Request class.
Here we will actually do a check to see if we have a usable connection and skip the waiting.
If we have to wait because there are zero connections we also allocate a RequestOperation with a properly configured timeout and add it to the timeHeap.
This means that the request will timeout within it's specified
timeout
irregardless of what the connection initTimeout value is.We clean up and cancel the timeout once a connection is identified and available
r: @zhijin @syyang