/** * While loop will exit all entries, * Case serviceId and URL entry twice in {@link SentinelPreFilter}. * The ContextUtil.getContext().getCurEntry() will exit from inner to outer. */ @Override public Object run() throws ZuulException { while (ContextUtil.getContext() != null && ContextUtil.getContext().getCurEntry() != null) { ContextUtil.getContext().getCurEntry().exit(); } ContextUtil.exit(); return null; } }
public static void exit(int count) { ContextUtil.getContext().getCurEntry().exit(count, OBJECTS0); }
public static void exit(int count, Object... args) { ContextUtil.getContext().getCurEntry().exit(count, args); }
/** * Trace provided {@link Throwable} and add exception count to entry in current context. * * @param e exception to record * @param count exception count to add */ public static void trace(Throwable e, int count) { if (e == null || e instanceof BlockException) { return; } Context context = ContextUtil.getContext(); if (context == null) { return; } DefaultNode curNode = (DefaultNode)context.getCurNode(); traceExceptionToNode(e, count, curNode); }
/** * Trace not {@link BlockException} ex. * While loop will exit all entries, * Case serviceId and URL entry twice in {@link SentinelPreFilter}. * The ContextUtil.getContext().getCurEntry() will exit from inner to outer. */ @Override public Object run() throws ZuulException { try { RequestContext ctx = RequestContext.getCurrentContext(); Throwable throwable = ctx.getThrowable(); if (throwable != null) { if (!BlockException.isBlockException(throwable)) { Tracer.trace(throwable.getCause()); RecordLog.info("[Sentinel Error Filter] Trace cause", throwable.getCause()); } } } finally { while (ContextUtil.getContext() != null && ContextUtil.getContext().getCurEntry() != null) { ContextUtil.getContext().getCurEntry().exit(); } ContextUtil.exit(); } return null; } }
private Entry entryWithPriority(ResourceWrapper resourceWrapper, int count, boolean prioritized, Object... args) throws BlockException { Context context = ContextUtil.getContext(); if (context instanceof NullContext) {
private AsyncEntry asyncEntryWithPriorityInternal(ResourceWrapper resourceWrapper, int count, boolean prioritized, Object... args) throws BlockException { Context context = ContextUtil.getContext(); if (context instanceof NullContext) {
public static void exit(int count, Object... args) { ContextUtil.getContext().getCurEntry().exit(count, args); }
public static void exit(int count) { ContextUtil.getContext().getCurEntry().exit(count, OBJECTS0); }
public static void trace(Throwable e, int count) { if (e instanceof BlockException) { return; } Context context = ContextUtil.getContext(); if (context == null) { return; } DefaultNode curNode = (DefaultNode)context.getCurNode(); if (curNode == null) { return; } // clusterNode can be null when Constants.ON is false. ClusterNode clusterNode = curNode.getClusterNode(); if (clusterNode == null) { return; } clusterNode.trace(e, count); }
private Entry entryWithPriority(ResourceWrapper resourceWrapper, int count, boolean prioritized, Object... args) throws BlockException { Context context = ContextUtil.getContext(); if (context instanceof NullContext) {
private AsyncEntry asyncEntryWithPriorityInternal(ResourceWrapper resourceWrapper, int count, boolean prioritized, Object... args) throws BlockException { Context context = ContextUtil.getContext(); if (context instanceof NullContext) {