mirror of https://github.com/apache/cassandra
Only wait until native_transport_timeout for dispatcher to finish
Patch by brandonwilliams; reviewed by maedhroz and smiklosovic for CASSANDRA-19697
This commit is contained in:
parent
531de93369
commit
3d878201fb
|
|
@ -1,4 +1,5 @@
|
|||
5.0-beta2
|
||||
* Only wait until native_transport_timeout for dispatcher to finish (CASSANDRA-19697)
|
||||
* Disable chronicle analytics (CASSANDRA-19656)
|
||||
* Replace Stream iteration with for-loop for StorageProxy::updateCoordinatorWriteLatencyTableMetric (CASSANDRA-19676)
|
||||
* Enforce metric naming contract if scope is used in a metric name (CASSANDRA-19619)
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ import org.apache.cassandra.service.*;
|
|||
import org.apache.cassandra.transport.messages.EventMessage;
|
||||
import org.apache.cassandra.utils.FBUtilities;
|
||||
|
||||
import static org.apache.cassandra.utils.Clock.Global.nanoTime;
|
||||
|
||||
public class Server implements CassandraDaemon.Server
|
||||
{
|
||||
static
|
||||
|
|
@ -183,8 +185,16 @@ public class Server implements CassandraDaemon.Server
|
|||
{
|
||||
if (!force)
|
||||
{
|
||||
long deadline = nanoTime() + DatabaseDescriptor.getNativeTransportTimeout(TimeUnit.NANOSECONDS);
|
||||
while (!dispatcher.isDone())
|
||||
{
|
||||
if (nanoTime() > deadline)
|
||||
{
|
||||
logger.warn("Some connections took longer than the native transport timeout to complete");
|
||||
break;
|
||||
}
|
||||
LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(100));
|
||||
}
|
||||
}
|
||||
|
||||
// Close opened connections
|
||||
|
|
|
|||
Loading…
Reference in New Issue