Return true if the route used for the current connection should be retried, even if the
connection itself is unhealthy. The biggest gotcha here is that we shouldn't reuse routes from
coalesced connections.
431695
private boolean retryCurrentRoute() {
    return transmitter.connection != null
        && transmitter.connection.routeFailureCount == 0
        && Util.sameConnection(transmitter.connection.route().address().url(), address.url());
  }
449411
public static boolean reconnectContext(RedirectException re, CommandContext ctx) {
        boolean reconnected = false;
        try {
            ConnectionInfo info = ctx.getConnectionInfo();
            ControllerAddress address = null;
            if (info != null) {
                address = info.getControllerAddress();
            }
            if (address != null && isHttpsRedirect(re, address.getProtocol())) {
                LOG.debug("Trying to reconnect an http to http upgrade");
                try {
                    ctx.connectController();
                    reconnected = true;
                } catch (Exception ex) {
                    LOG.warn("Exception reconnecting", ex);
                    // Proper https redirect but error.
                    // Ignoring it.
                }
            }
        } catch (URISyntaxException ex) {
            LOG.warn("Invalid URI: ", ex);
            // OK, invalid redirect.
        }
        return reconnected;
    }
373785
public function usePersistentConnection()
    {
        if (isset($this->outgoing_headers['Accept-Encoding'])) {
            return false;
        }
        $this->protocol_version = '1.1';
        $this->persistentConnection = true;
        $this->setHeader('Connection', 'Keep-Alive');
        return true;
    }
179701
public boolean isArrivalEvent(@NonNull RouteProgress routeProgress) {
    RouteProgressState currentState = routeProgress.currentState();
    return currentState != null && currentState == RouteProgressState.ROUTE_ARRIVED;
  }
76959
private static boolean isRedirect(int statusCode) {
        return statusCode == HttpURLConnection.HTTP_MOVED_PERM ||
                statusCode == HttpURLConnection.HTTP_MOVED_TEMP ||
                statusCode == HttpURLConnection.HTTP_SEE_OTHER;
    }
351363
public boolean isConnectionStale() {
        if (lastUsedTime == 0)
            return false;

        long currentTime = System.currentTimeMillis();
        long timeSinceLastUse = currentTime - lastUsedTime;
        return (timeSinceLastUse > MAX_KEEPALIVE);
    }
897429
def _is_connreset(self, exc: BaseException) -> bool:
        
        return (
            isinstance(exc, (socket.error, IOError))
            and errno_from_exception(exc) in _ERRNO_CONNRESET
        )
580773
def resend_sent(self, route_family, peer):
        
        if peer not in self._peers.values():
            raise ValueError('Could not find given peer (%s)' % peer)

        if route_family not in SUPPORTED_GLOBAL_RF:
            raise ValueError(
                'Given route family (%s) is not supported.' % route_family
            )

        # Iterate over the global table for given afi, safi and enqueue
        # out-going routes.
        table = self._table_manager.get_global_table_by_route_family(
            route_family
        )

        for destination in table.values():
            # Check if this destination's sent - routes include this peer.
            # i.e. check if this destinations was advertised and enqueue
            # the path only if it was. If the current best-path has not been
            # advertised before, it might already have a OutgoingRoute queued
            # to be sent to the peer.
            sent_routes = destination.sent_routes
            if sent_routes is None or len(sent_routes) == 0:
                continue
            for sent_route in sent_routes:
                if sent_route.sent_peer == peer:
                    # update med - if previously med was set per neighbor or
                    # wasn't set at all now it could have changed and we may
                    # need to set new value there
                    p = sent_route.path
                    if p.med_set_by_target_neighbor or p.get_pattr(
                            BGP_ATTR_TYPE_MULTI_EXIT_DISC) is None:
                        sent_route.path = \
                            clone_path_and_update_med_for_target_neighbor(
                                sent_route.path, peer.med
                            )

                    ogr = OutgoingRoute(sent_route.path,
                                        for_route_refresh=True)
                    peer.enque_outgoing_msg(ogr)
1103785
def reconnect(self):
        
        # This is the old connection instance, stop its ioloop.
        self._connection.ioloop.stop()
        if self._running:
            # Create a new connection
            self.connect()
            # There is now a new connection, needs the new ioloop to run.
            self._connection.ioloop.start()
1253777
private boolean isRecursiveDeleteSafe(@Nullable AlluxioURI alluxioUri) {
    if (alluxioUri == null || !alluxioUri.toString().startsWith(mRootPath.toString())) {
      // Path is not part of sub-tree being deleted
      return false;
    }
    if (mUfsSyncChecker == null) {
      // Delete is unchecked
      return true;
    }
    return mUfsSyncChecker.isDirectoryInSync(alluxioUri);
  }
838329
protected void renewConnection() {
		this.logicallyClosed.set(false);
		this.threadUsingConnection = Thread.currentThread();
		if (this.doubleCloseCheck){
			this.doubleCloseException = null;
		}
	}
817770
protected function matchRoute()/*# : bool */
    {
        foreach ($this->getCollectors() as $coll) {
            if ($coll->matchRoute($this->result)) {
                return true;
            }
        }
        return false;
    }
224763
public function reconnect()
    {
        if ($this->getMaxReconnects() < $this->getReconnectCount()) {
            return false;
        }

        $this->increaseReconnectCount();
        // returns the state if the ping was possible
        return $this->ping();
    }
1221077
public boolean isReverseRoutingPathEmpty() {
        /* If it is never been set, or been set to null, localonly will be null. */
        if (getHdr2().getField(JsHdr2Access.REVERSEROUTINGPATHLOCALONLY) == null) {
            return true;
        }
        /* Otherwise it is possible for it to be 0 length. */
        else if (((byte[]) getHdr2().getField(JsHdr2Access.REVERSEROUTINGPATHLOCALONLY)).length == 0) {
            return true;
        }
        else
            return false;
    }
780137
private boolean removeServantRoutingAffinity() {
        if (ivServantRoutingAffinity) {
            StatefulSessionKey sskey = (StatefulSessionKey) beanId.getPrimaryKey();
            byte[] pKeyBytes = sskey.getBytes();

            int retcode = container.ivStatefulBeanEnqDeq.SSBeanDeq(pKeyBytes, !home.beanMetaData.sessionActivateTran, true);
            if (retcode != 0) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    Tr.event(tc, "Could not DEQ session bean with key = " + sskey);
                return false;
            }

            ivServantRoutingAffinity = false;
        }

        return true;
    }
361682
private function specificRouteRestrictionExists()
    {
        $requestMethod = isset($_POST['_method']) ? $_POST['_method'] : $_SERVER['REQUEST_METHOD'];
        
        $routes = app('router')->getRoutes()->match(app('request')->create($_SERVER['REQUEST_URI'], $requestMethod));


        if (!$routes) {
            throw new Exception('Error determining current route.');
        }

        if (get_class($routes) != \Illuminate\Routing\Route::class && count($routes) != 1) {
            $routes = $routes->first();
        }
        
        foreach($routes->middleware() as $routeMiddleware) {
            $routeMiddlewareParts = explode(':', $routeMiddleware);
            if ($routeMiddlewareParts[0]=='routeRestrictor') {
                return true;
            }
        }

        return false;
    }
1094483
def reconnect(self):
        """"""
        try:
            self.conn.close()
        except Exception,e:
            self.logger.warn(e)

        self.createConnection()

        return True