乐于分享
好东西不私藏

ThreadForge 源码解读二:一个 Task 从 submit 到完成,内部到底发生了什么?

ThreadForge 源码解读二:一个 Task 从 submit 到完成,内部到底发生了什么?

上一篇讲的是边界:ThreadScope 负责把一批并发任务收进同一个生命周期。

这一篇往里再走一层,直接来看执行链路,带着问题来看:

一个 Task 从 submit(...) 到最后成功、失败或取消,中间到底经历了什么?

1. 为什么要有 Task<T>

CompletableFuture 本身已经非常强大了,但业务代码处理并发阶段时,往往还需要这些东西:

  • 明确的任务名称
  • 一眼就能看明白的状态机
  • 实际执行线程的记录
  • 稳定的取消入口
  • 生命周期绑定
  • 更贴近业务的等待和异常语义

所以 ThreadForge 额外包装了一层 Task<T> 做对外暴露。

Task 的核心字段在 src/main/java/io/threadforge/Task.java

ounter(lineounter(lineounter(lineounter(lineounter(lineprivate final long id;private final String name;private final CompletableFuture<T> future;private final AtomicReference<State> state;private final AtomicReference<Thread> runnerThread;

状态定义如下:

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(linepublic enum State {    PENDING,    RUNNING,    SUCCESS,    FAILED,    CANCELLED}

可以先这样来理解 :

Task<T> 是带状态机、元信息和取消能力的任务句柄。

2. Task 状态流转:从 PENDING 到终态

5 个状态,5 个状态切换方法,路径很少,清晰明了:

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(linestateDiagram-v2    [*] --> PENDING: new Task    PENDING --> RUNNING: markRunning(thread)    RUNNING --> SUCCESS: markSuccess()    RUNNING --> FAILED: markFailed()    RUNNING --> CANCELLED: markCancelled()    PENDING --> CANCELLED: cancel before run    PENDING --> FAILED: rejected / timeout    SUCCESS --> [*]    FAILED --> [*]    CANCELLED --> [*]

状态切换的入口都在 Task 上,包级可见,外部只能读:

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(line// 包级 — 由 ThreadScope 在正确时机调用boolean markRunning(Thread runner)void markSuccess()void markFailed()void markCancelled()void interruptRunner()

先看 markRunning(...)

ounter(lineounter(lineounter(lineounter(lineboolean marked = state.compareAndSet(State.PENDING, State.RUNNING);if (marked) {    runnerThread.set(runner);}

主要做了两件事:

  1. CAS 从 PENDING 切到 RUNNING——只有一个线程能成功
  2. 成功后把执行线程记下来——后面取消时知道该中断谁

如果 CAS 失败(比如任务在排队的间隙被 cancel 了),方法返回 false,调用方跳过执行。这就是 cancel 和 markRunning 之间的竞态保护:cancel 先改状态为 CANCELLED,markRunning 的 CAS 就会失败,任务不会开始跑。

其余三个终态方法结构对称——清掉 runner 引用,设置状态:

ounter(lineounter(lineounter(linevoid markSuccess()    { runnerThread.set(null); state.set(State.SUCCESS); }void markFailed()     { runnerThread.set(null); state.set(State.FAILED); }void markCancelled()  { runnerThread.set(null); state.set(State.CANCELLED); }

终态后 runnerThread 清理成 null,避免外界持有一个已终止线程的句柄。

3. cancel:三步走,协作式终止

Task.cancel() 实现很简洁:

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(linepublic boolean cancel() {    state.set(State.CANCELLED);    Thread runner = runnerThread.get();    if (runner != null) {        runner.interrupt();    }    return future.cancel(true);}

其实就三步,保持顺序:

  1. 「先设状态为 CANCELLED——这一步配合上一节讲的 markRunning CAS,抢占式阻止任务启动
  2. 「再中断 runner」——如果任务已经在跑,发中断信号;如果还没拿到 runner,跳过
  3. 「最后取消底层 future」——future.cancel(true) 会尝试中断 future 内部的执行线程

注意为什么是「协作式」终止:Thread.interrupt() 只是发信号,不是强行杀线程。任务代码、阻塞点、中断处理逻辑要一起配合才能停下来。ThreadForge 靠三层协作:

  • Thread.interrupt() —— 唤醒阻塞中的线程
  • CancellationToken.throwIfCancelled() —— 任务代码主动检查取消点
  • 任务业务逻辑对中断的响应 —— 捕获 InterruptedException 后做清理并退出

单独哪一层都不够,三层叠加才算是可靠。

4. submit 的完整时序:从参数校验到进入调度器

ThreadScope 有十几个 submit(...) 重载,全部收敛到一个私有方法。去掉参数校验和并发许可申请后,核心构造逻辑如下:

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(linefinal CompletableFuture<T> future = new CompletableFuture<T>();final Task<T> task = new Task<T>(id, name, future);final TaskInfo info = new TaskInfo(scopeId, id, name, Instant.now(), scheduler.name());final ExecutionContextCarrier executionContext = ExecutionContextCarrier.capture();final ScheduledTask timeoutTask = scheduleTaskTimeout(task, info, taskTimeout);tasks.add(task);future.whenComplete((value, throwable) -> {    tasks.remove(task);    if (timeoutTask != null) {        timeoutTask.cancel();    }});

然后交给调度器:

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(linescheduler.executor().execute(Scheduler.prioritized(    executionContext.wrapRunnable(() -> runTask(task, info, callable, taskRetryPolicy,        permitAcquired ? semaphore : null)),    taskPriority,    id));

如果调度器拒绝执行(RejectedExecutionException),框架会释放并发许可、标记任务失败并触发 hook。

逐行看:

  • 建 CompletableFuture — 任务结果的载体
  • 建 Task — 带状态机和元信息的句柄
  • 建 TaskInfo — 观测用的快照数据
  • 捕获上下文 — Context 和 OpenTelemetry 双份
  • 注册任务级 timeout — 可选的独立时间预算
  • 登记到 tasks — scope 后续可以捞出所有任务
  • 「注册 whenComplete 回调」 — 任务无论成功、失败还是取消,结束时自动从 tasks 队列移除,同时取消关联的 timeout 任务
  • 包成带优先级的 runnable,交给调度器
ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(linesequenceDiagram    participant User    participant Scope as ThreadScope    participant Context as ExecutionContextCarrier    participant Scheduler    participant Task    participant Retry as RetryExecutor    participant Hook as ThreadHook    participant Metrics    User->>Scope: submit(name, callable)    Scope->>Scope: lockConfiguration()    Scope->>Scope: acquireSubmissionPermit()    Scope->>Task: new Task(id, name, future)    Scope->>Context: capture()    Scope->>Scope: scheduleTaskTimeout()    Scope->>Scope: tasks.add(task)    Scope->>Scheduler: executor.execute(prioritizedRunnable)    Scheduler->>Scope: runTask(task, callable)    Scope->>Task: markRunning(currentThread)    Scope->>Hook: onStart(info)    Scope->>Metrics: recordStart()    Scope->>Retry: execute(callable, retryPolicy, token)    alt callable success        Retry-->>Scope: value        Scope->>Task: markSuccess()        Scope->>Hook: onSuccess(info, duration)        Scope->>Metrics: recordTerminal(SUCCESS)    else callable failed        Retry-->>Scope: throwable        Scope->>Task: markFailed()        Scope->>Hook: onFailure(info, error, duration)        Scope->>Metrics: recordTerminal(FAILED)    else cancelled        Scope->>Task: markCancelled()        Scope->>Hook: onCancel(info, duration)        Scope->>Metrics: recordTerminal(CANCELLED)    end

上半段提交,下半段执行,最后按成功、失败、取消三条路径收尾。

5. runTask(...):真正执行任务的内核

runTask(...) 是整条链路的执行引擎。完整方法约 40 行,精简后主结构如下:

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(linelong started = System.nanoTime();CompletableFuture<T> future = task.toCompletableFuture();try {    // ① 启动前双重取消检查    if (task.isCancelled() || token.isCancelled()) {        completeTaskCancelled(task, future, new CancelledException("..."), info, started);        return;    }    // ② 状态机: PENDING → RUNNING    if (!task.markRunning(Thread.currentThread())) {        return;    }    // ③ 触发观测    safeHookStart(info);    token.throwIfCancelled();    // ④ 真正执行(含重试)    T value = RetryExecutor.execute(callable, retryPolicy, token);    if (future.complete(value)) {        task.markSuccess();        safeHookSuccess(info, elapsedNanos(started));    }} catch (InterruptedException e) {    Thread.currentThread().interrupt();    completeTaskCancelled(task, future, new CancelledException("..."), info, started);} catch (CancelledException e) {    completeTaskCancelled(task, future, e, info, started);} catch (Throwable t) {    completeTaskFailure(task, future, t, info, started);} finally {    if (acquiredSemaphore != null) {        acquiredSemaphore.release(); // 释放并发许可    }}

异常走了三条分叉:

  • InterruptedException → 重置线程中断标志后走取消路径
  • CancelledException → 直接走取消路径
  • 其他 Throwable → 走失败路径(completeTaskFailure 内部通过 future.completeExceptionally(...) 把异常写入 future,再调用 task.markFailed() 和 hook)

失败、取消、重试、并发许可——全收在这一个方法里。

6. Scheduler:执行策略和所有权分离

ounter(lineounter(lineounter(lineounter(lineprivate final ExecutorService executor;private final boolean ownsExecutor;private final String name;private final boolean virtualThreadMode;

四个字段,四个职责:

  • executor — 任务交给谁执行
  • ownsExecutor — scope 关闭时要不要连带关掉执行器
  • name — 日志和观测里的标识
  • virtualThreadMode — 是否跑在虚拟线程上

6.1 Scheduler.detect()

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(linepublic static Scheduler detect() {    if (isVirtualThreadSupported()) {        return virtualThreads();    }    return commonPool();}

isVirtualThreadSupported() 通过反射探测 Executors.newVirtualThreadPerTaskExecutor()virtualThreads() 内部 DCL 延迟创建。反射找不到方法或调用失败,自动回退到 commonPool()。调用方一行不用改。

6.2 Scheduler.fixed(int size)

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineint queueCapacity = Math.max(256, size * 100);new ThreadPoolExecutor(    size, size, 60L, TimeUnit.SECONDS,    new LinkedBlockingQueue<Runnable>(queueCapacity),    new NamedThreadFactory("threadforge-fixed"),    new ThreadPoolExecutor.CallerRunsPolicy());executor.allowCoreThreadTimeOut(true);
  • core = max,固定线程数;线程打满后任务入有界队列
  • queueCapacity 至少 256,随线程数线性放大
  • CallerRunsPolicy:队列满时提交线程自己执行,形成自然反压
  • allowCoreThreadTimeOut(true):空闲超过 60 秒的核心线程也回收,避免高峰过后空转

6.3 Scheduler.priority(int size)

同样固定线程池,但队列换成无界的 PriorityBlockingQueue

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(linenew ThreadPoolExecutor(    size, size, 60L, TimeUnit.SECONDS,    new PriorityBlockingQueue<Runnable>(),    new NamedThreadFactory("threadforge-priority"),    new ThreadPoolExecutor.CallerRunsPolicy());

队列无界,CallerRunsPolicy 一般不会被触发。优先级靠 PrioritizedRunnable.compareTo(...) 实现:

ounter(lineounter(lineounter(lineint byPriority = Integer.compare(this.taskPriority.rank(), other.taskPriority.rank());if (byPriority != 0) return byPriority;return Long.compare(this.sequence, other.sequence);

先按 TaskPriority 排,同优先级按提交顺序(FIFO)。

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineflowchart TD    A[Scheduler.detect] --> B{JDK 支持虚拟线程?}    B -->|是| C[virtualThreads]    B -->|否| D[commonPool]    E[Scheduler.fixed] --> F[ThreadPoolExecutor + LinkedBlockingQueue]    G[Scheduler.priority] --> H[ThreadPoolExecutor + PriorityBlockingQueue]    I[Scheduler.from] --> J[外部 ExecutorService]    C --> K[executor.execute]    D --> K    F --> K    H --> K    J --> K

无论哪种方式创建,最后都从 executor.execute(...) 出去。

7. ExecutionContextCarrier:线程切换时,上下文怎么跟着走

线程切换后,提交线程里的 Context 和 OpenTelemetry 上下文就断了——两者都基于线程局部变量。ExecutionContextCarrier 专门解决这个问题:

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(line// 提交时捕获static ExecutionContextCarrier capture() {    return new ExecutionContextCarrier(        Context.capture(),        OpenTelemetryBridge.currentContext()    );}// 执行时安装,结束后恢复Context.Snapshot previous = Context.install(contextSnapshot);Object scope = OpenTelemetryBridge.makeCurrent(otelParentContext);try {    return callable.call();} finally {    OpenTelemetryBridge.closeScope(scope);    Context.restore(previous);}

传播了两类上下文:

  1. Context —— ThreadForge 自己的线程局部变量
  2. OpenTelemetry —— 外部 Tracing 系统的当前 span

submit 时 capture,执行时 install,结束后 restore。

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(linesequenceDiagram    participant Main as 提交线程    participant Carrier as ExecutionContextCarrier    participant Worker as 工作线程    participant Context    participant OTel as OpenTelemetryBridge    Main->>Context: Context.put(traceId)    Main->>Carrier: capture()    Carrier->>Context: Context.capture()    Carrier->>OTel: currentContext()    Worker->>Carrier: wrapCallable.call()    Carrier->>Context: install(snapshot)    Carrier->>OTel: makeCurrent(parentContext)    Worker->>Worker: 执行业务 callable    Carrier->>OTel: closeScope()    Carrier->>Context: restore(previous)

8. RetryExecutor:重试为什么必须感知取消

RetryExecutor 的核心循环是这样的:

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(linewhile (true) {    token.throwIfCancelled();    try {        return callable.call();    } catch (InterruptedException e) {        throw e;                    // 中断直接透传,不重试    } catch (CancelledException e) {        throw e;                    // 取消直接透传,不重试    } catch (Throwable failure) {        if (!retryPolicy.allowsRetry(attempt, failure)) {            // 不再重试,把之前所有失败附加到 suppressed            if (previousFailures != null) {                for (Throwable prev : previousFailures) {                    if (prev != failure) failure.addSuppressed(prev);                }            }            throw failure;        }        previousFailures.add(failure);        sleepBeforeRetry(retryPolicy.nextDelay(attempt, failure), token);        attempt++;    }}
  1. 「中断和取消直接透传」——不是业务失败,不能重试,框架必须立即响应
  2. 「每次循环先检查 token」——上次执行成功后,下一轮也要看 scope 是否已取消
  3. 「sleep 分片」——每 100ms 醒来检查一次取消

sleepBeforeRetry(...) 实现:

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(linelong remainingMillis = delay.toMillis();while (remainingMillis > 0L) {    token.throwIfCancelled();    long chunk = Math.min(remainingMillis, 100L);    Thread.sleep(chunk);    remainingMillis -= chunk;}

重试也要服从作用域的取消和 deadline。

如果最终还是失败,前面每次失败的异常会累加到最终异常的 suppressed 里——排查时能看到完整的失败历史,不是只有最后一次的错误信息。

ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineflowchart TD    A[RetryExecutor.execute] --> B[token.throwIfCancelled]    B --> C[callable.call]    C -->|成功| D[返回结果]    C -->|InterruptedException| E[直接抛出]    C -->|CancelledException| F[直接抛出]    C -->|其他异常| G{RetryPolicy 允许重试?}    G -->|否| H[附加 suppressed failures]    H --> I[抛出最终异常]    G -->|是| J[记录本次失败]    J --> K[计算 nextDelay]    K --> L[分片 sleep, 每 100ms 检查取消]    L --> M[attempt++]    M --> B

分片 sleep 是关键:假设重试要等 5 秒,整段睡过去,中途收到取消信号就会反应慢半拍。分成 100ms 的小段,每段醒来检查一次取消,scope 一喊停就能更快响应。

9. 两层时间预算:scope deadline + task timeout

9.1 scope 级 deadline

ounter(linewithDeadline(Duration)

配置整个 ThreadScope 的截止时间。到达后:

  • deadlineTriggered = truetoken.cancel()
  • 作用域内所有任务收到取消信号
  • 后续等待抛出 ScopeTimeoutException

9.2 task 级 timeout

ounter(linescope.submit("rpc-a", callable, Duration.ofMillis(200));

给单个任务设置独立预算。内部注册一个超时任务:

ounter(lineounter(lineounter(lineounter(lineounter(lineif (task.toCompletableFuture().completeExceptionally(timeoutException)) {    task.markFailed();    task.interruptRunner();    safeHookFailure(info, timeoutException, timeout.toNanos());}

只影响当前任务:标记失败、中断执行线程、触发 hook。不影响 scope 内其他任务。

类型
作用范围
触发后影响
适合场景
scope deadline
整个 ThreadScope
取消整个作用域
一个请求、一个批处理的总预算
task timeout
单个 Task
当前任务失败并中断 runner
某个 RPC、IO 的独立预算

一个管全局,一个管局部。

10. Hook 和 Metrics:观测内嵌在执行链路里

ThreadHook 是 interface,4 个方法全是 default——只覆写需要的:

ounter(lineounter(lineounter(lineounter(linedefault void onStart(TaskInfo info) {}default void onSuccess(TaskInfo info, Duration duration) {}default void onFailure(TaskInfo info, Throwable error, Duration duration) {}default void onCancel(TaskInfo info, Duration duration) {}

通过 andThen(...) 组合多个 hook,每个回调内部独立 catch 异常——前一个抛异常不阻止后续执行:

ounter(lineThreadHook combined = hook1.andThen(hook2).andThen(hook3);

元信息来自 TaskInfo

ounter(linenew TaskInfo(scopeId, id, name, Instant.now(), scheduler.name())

内置指标由 ScopeMetrics 维护,LongAdder + AtomicLong,竞争开销低:

ounter(lineounter(linestarted / succeeded / failed / cancelledtotalDurationNanos / maxDurationNanos

观测和执行事件发生在同一时刻:

ounter(lineounter(lineounter(linesafeHookStart(info);   metrics.recordStart();// ... 执行 ...safeHookSuccess(...)   metrics.recordTerminal(Task.State.SUCCESS, ...)
ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineflowchart TD    A[runTask 开始] --> B[safeHookStart]    B --> C[metrics.recordStart]    C --> D[执行业务 Callable]    D -->|成功| E[safeHookSuccess]    E --> F[metrics.recordTerminal SUCCESS]    D -->|失败| G[safeHookFailure]    G --> H[metrics.recordTerminal FAILED]    D -->|取消| I[safeHookCancel]    I --> J[metrics.recordTerminal CANCELLED]

任务走到哪个生命周期节点,hook 和 metrics 就跟到哪里。

写在最后

最近换工作,刚进了一个新团队。上家的节奏比较正常,现在几乎每天加班赶进度。

说不清忙和闲哪个更好。

职位又往上走了一步,压力也跟着翻了一倍。

向上对齐、向下兜底,还是技术最纯粹。没有汇报,没有上下级,简单而美好。

这一篇是 ThreadForge 源码解读的执行链路部分,下一篇继续,解读高阶编排怎么在一个 scope 里协同工作。 也算是给整个系列收官。

项目地址:github.com/wuuJiawei/ThreadForge,欢迎提 issue,也欢迎 star。

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-06-14 15:22:28 HTTP/1.1 GET : https://www.yeyulingfeng.com/a/748824.html
  2. 运行时间 : 0.114818s [ 吞吐率:8.71req/s ] 内存消耗:4,898.00kb 文件加载:145
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=ec9d6eb6a7982b3af3aa74c824068044
  1. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_static.php ( 6.05 KB )
  7. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/ralouphie/getallheaders/src/getallheaders.php ( 1.60 KB )
  10. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  11. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  12. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  13. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  14. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  15. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  16. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  17. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  18. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  19. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions_include.php ( 0.16 KB )
  21. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions.php ( 5.54 KB )
  22. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  23. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  24. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  25. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/provider.php ( 0.19 KB )
  26. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  27. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  28. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  29. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/common.php ( 0.03 KB )
  30. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  32. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/alipay.php ( 3.59 KB )
  33. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  34. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/app.php ( 0.95 KB )
  35. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cache.php ( 0.78 KB )
  36. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/console.php ( 0.23 KB )
  37. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cookie.php ( 0.56 KB )
  38. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/database.php ( 2.48 KB )
  39. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/filesystem.php ( 0.61 KB )
  40. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/lang.php ( 0.91 KB )
  41. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/log.php ( 1.35 KB )
  42. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/middleware.php ( 0.19 KB )
  43. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/route.php ( 1.89 KB )
  44. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/session.php ( 0.57 KB )
  45. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/trace.php ( 0.34 KB )
  46. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/view.php ( 0.82 KB )
  47. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/event.php ( 0.25 KB )
  48. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  49. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/service.php ( 0.13 KB )
  50. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/AppService.php ( 0.26 KB )
  51. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  52. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  53. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  54. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  55. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  56. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/services.php ( 0.14 KB )
  57. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  58. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  59. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  60. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  61. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  62. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  63. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  64. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  65. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  66. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  67. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  68. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  69. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  70. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  71. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  72. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  73. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  74. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  75. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  76. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  77. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  78. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  79. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  80. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  81. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  82. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  83. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  84. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  85. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  86. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  87. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/Request.php ( 0.09 KB )
  88. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  89. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/middleware.php ( 0.25 KB )
  90. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  91. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  92. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  93. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  94. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  95. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  96. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  97. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  98. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  99. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  100. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  101. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  102. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  103. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/route/app.php ( 3.94 KB )
  104. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  105. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  106. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Index.php ( 9.87 KB )
  108. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/BaseController.php ( 2.05 KB )
  109. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  110. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  111. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  112. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  113. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  114. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  115. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  116. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  117. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  118. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  119. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  120. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  121. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  122. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  123. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  124. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  125. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  126. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  127. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  128. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  129. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  130. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  131. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  132. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  133. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  134. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  135. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Es.php ( 3.30 KB )
  136. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  137. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  138. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  139. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  140. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  141. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  142. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  143. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  144. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/runtime/temp/c935550e3e8a3a4c27dd94e439343fdf.php ( 31.50 KB )
  145. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000605s ] mysql:host=127.0.0.1;port=3306;dbname=wenku;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000776s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.003544s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000304s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000515s ]
  6. SELECT * FROM `set` [ RunTime:0.000205s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000572s ]
  8. SELECT * FROM `article` WHERE `id` = 748824 LIMIT 1 [ RunTime:0.000751s ]
  9. UPDATE `article` SET `lasttime` = 1781421748 WHERE `id` = 748824 [ RunTime:0.016023s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 64 LIMIT 1 [ RunTime:0.000278s ]
  11. SELECT * FROM `article` WHERE `id` < 748824 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000497s ]
  12. SELECT * FROM `article` WHERE `id` > 748824 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000460s ]
  13. SELECT * FROM `article` WHERE `id` < 748824 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001067s ]
  14. SELECT * FROM `article` WHERE `id` < 748824 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001624s ]
  15. SELECT * FROM `article` WHERE `id` < 748824 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.002094s ]
0.116525s