/** * @param ackTimeout Acknowledgement timeout. * @return {@code True} if acknowledgement timeout is less or equal to * maximum acknowledgement timeout, {@code false} otherwise. */ private boolean checkAckTimeout(long ackTimeout) { if (ackTimeout > maxAckTimeout) { LT.warn(log, null, "Acknowledgement timeout is greater than maximum acknowledgement timeout " + "(consider increasing 'maxAckTimeout' configuration property) " + "[ackTimeout=" + ackTimeout + ", maxAckTimeout=" + maxAckTimeout + ']'); return false; } return true; }
/** {@inheritDoc} */ @Override public boolean evictExclude(GridGgfsPath path, boolean primary) { assert path != null; try { // Exclude all PRIMARY files + the ones specified in eviction policy as exclusions. return primary || evictPlc == null || evictPlc.exclude(path); } catch (GridException e) { LT.error(log, e, "Failed to check whether the path must be excluded from evictions: " + path); return false; } }
/** {@inheritDoc} */ @Override public boolean evictExclude(GridGgfsPath path, boolean primary) { assert path != null; try { // Exclude all PRIMARY files + the ones specified in eviction policy as exclusions. return primary || evictPlc == null || evictPlc.exclude(path); } catch (GridException e) { LT.error(log, e, "Failed to check whether the path must be excluded from evictions: " + path); return false; } }
/** * Validates that cache key or cache value implements {@link Externalizable} * * @param log Logger used to log warning message. * @param obj Cache key or cache value. */ private static void validateExternalizable(GridLogger log, Object obj) { Class<?> cls = obj.getClass(); if (!cls.isArray() && !U.isJdk(cls) && !(obj instanceof Externalizable) && !(obj instanceof GridCacheInternal)) LT.warn(log, null, "For best performance you should implement " + "java.io.Externalizable for all cache keys and values: " + cls.getName()); }
/** {@inheritDoc} */ @Override public GridNodeMetrics metrics() { if (metricsProvider != null) metrics = metricsProvider.getMetrics(); else if (metricsStore != null) try { GridNodeMetrics metrics = metricsStore.metrics(Collections.singletonList(id)).get(id); if (metrics != null) this.metrics = metrics; } catch (GridSpiException e) { LT.error(log, e, "Failed to get metrics from metrics store for node: " + this); } return metrics; }
/** * Starts chain notification from head to tail. * * @param ses Session in which GridNioException was caught. * @param e GridException instance. */ @Override public void onExceptionCaught(GridNioSession ses, GridException e) { try { head.onExceptionCaught(ses, e); } catch (Exception ex) { LT.warn(log, ex, "Failed to forward GridNioException to filter chain [ses=" + ses + ", e=" + e + ']'); } }
LT.warn(log, null, "Failed to read magic header (too few bytes received) [rmtAddr=" + sock.getRemoteSocketAddress() + ", locAddr=" + sock.getLocalSocketAddress() + ']'); LT.warn(log, null, "Unknown connection detected (is some other software connecting to " + "this GridGain port?) [rmtAddr=" + sock.getRemoteSocketAddress() + ", locAddr=" + sock.getLocalSocketAddress() + ']'); LT.error(log, e, "Failed to initialize connection [sock=" + sock + "]\n\t" + U.MAC_INVALID_ARG_MSG); else LT.error(log, e, "Failed to initialize connection [sock=" + sock + ']'); LT.warn(log, null, "Socket operation timed out on handshake " + "(consider increasing 'networkTimeout' configuration property) " + "[netTimeout=" + netTimeout + ']'); LT.warn(log, null, "Failed to read message due to ClassNotFoundException " + "(make sure same versions of all classes are available on all nodes) " + "[rmtAddr=" + sock.getRemoteSocketAddress() + LT.error(log, e, "Failed to initialize connection [sock=" + sock + ']'); LT.warn(log, null, "Failed to read message due to ClassNotFoundException " + "(make sure same versions of all classes are available on all nodes) " + "[rmtNodeId=" + nodeId + LT.error(log, e, "Failed to read message [sock=" + sock + ", locNodeId=" + locNodeId + ", rmtNodeId=" + nodeId + ']');
LT.error(log, e, "Type of job context priority attribute '" + jobPriAttrKey + "' is not java.lang.Integer [type=" + jctx.getAttribute(jobPriAttrKey).getClass() + ']'); LT.error(log, e, "Type of task session priority attribute '" + taskPriAttrKey + "' is not java.lang.Integer [type=" + ses.getAttribute(taskPriAttrKey).getClass() + ']');
LT.warn(log, null, "Timed out waiting for message delivery receipt (most probably, the reason is " + "in long GC pauses on remote node; consider tuning GC and increasing 'ackTimeout' " + "configuration property). Will retry to send message with increased timeout. " +
LT.warn(log, null, errMsg); LT.warn(log, null, "Ignoring join request from node (duplicate ID) [node=" + node + ", existingNode=" + existingNode + ']'); LT.warn(log, null, "Authentication failed [nodeId=" + node.id() + ", addrs=" + U.addressesAsString(node) + ']', LT.warn(log, null, "Authentication subject is not Serializable [nodeId=" + node.id() + ", addrs=" + U.addressesAsString(node) + ']', LT.error(log, e, "Authentication failed [nodeId=" + node.id() + ", addrs=" + U.addressesAsString(node) + ']'); LT.warn(log, null, err.message()); LT.warn(log, null, errMsg); LT.warn(log, null, errMsg); LT.warn(log, null, errMsg); LT.warn(log, null, errMsg); LT.warn(log, null, errMsg);
/** * Cleans metrics store. */ private void cleanMetricsStore() { assert metricsStore != null; try { Collection<UUID> ids = F.view(metricsStore.allNodeIds(), F.notContains( F.viewReadOnly(ring.allNodes(), F.node2id()))); if (!ids.isEmpty()) metricsStore.removeMetrics(ids); } catch (GridSpiException e) { LT.error(log, e, "Failed to clean metrics store up."); } } }
LT.warn(log, null, "Timed out waiting for message to be read (most probably, the reason is " + "in long GC pauses on remote node. Current timeout: " + timeout + '.');
LT.error(log, e, "Failed to do service reassignment (will retry): " + dep.configuration().getName());
/** {@inheritDoc} */ @Override public void onMessageReceived(GridNioSession ses, Object msg) throws GridException { if (!(msg instanceof ByteBuffer)) throw new GridNioException("Failed to decode incoming message (incoming message is not a byte buffer, " + "is filter properly placed?): " + msg.getClass()); try { ByteBuffer input = (ByteBuffer)msg; while (input.hasRemaining()) { Object res = parser.decode(ses, input); if (res != null) proceedMessageReceived(ses, res); else { if (input.hasRemaining()) { if (directMode) return; LT.warn(log, null, "Parser returned null but there are still unread data in input buffer (bug in " + "parser code?) [parser=" + parser + ", ses=" + ses + ']'); input.position(input.limit()); } } } } catch (IOException e) { throw new GridNioException(e); } }
/** * @throws GridSpiException If failed. */ @SuppressWarnings("BusyWait") private void registerLocalNodeAddress() throws GridSpiException { // Make sure address registration succeeded. while (true) { try { ipFinder.initializeLocalAddresses(locNode.socketAddresses()); // Success. break; } catch (IllegalStateException e) { throw new GridSpiException("Failed to register local node address with IP finder: " + locNode.socketAddresses(), e); } catch (GridSpiException e) { LT.error(log, e, "Failed to register local node address in IP finder on start " + "(retrying every 2000 ms)."); } try { U.sleep(2000); } catch (GridInterruptedException e) { throw new GridSpiException("Thread has been interrupted.", e); } } }
LT.warn(log, e, "Unable to update underlying store: " + store);
@Override public GridRestResponse apply(GridFuture<GridRestResponse> f) { GridRestResponse res; try { res = f.get(); } catch (Exception e) { LT.error(log, e, "Failed to handle request: " + req.command()); if (log.isDebugEnabled()) log.debug("Failed to handle request [req=" + req + ", e=" + e + "]"); res = new GridRestResponse(STATUS_FAILED, e.getMessage()); } assert res != null; if (ctx.secureSession().enabled()) { try { res.sessionTokenBytes(updateSessionToken(req, subjCtx0)); } catch (GridException e) { U.warn(log, "Cannot update response session token: " + e.getMessage()); } } interceptResponse(res, req); return res; } });
@Override public void onSessionWriteTimeout(GridNioSession ses) { LT.warn(log, null, "Communication SPI Session write timed out (consider increasing " + "'socketWriteTimeout' " + "configuration property) [remoteAddr=" + ses.remoteAddress() + ", writeTimeout=" + sockWriteTimeout + ']'); if (log.isDebugEnabled()) log.debug("Closing communication SPI session on write timeout [ses=" + ses + ", writeTimeout=" + sockWriteTimeout + ']'); ses.close(); }