Skip to content

Thread.start() will create a new trace #8082

Closed
@soulmate1314

Description

@soulmate1314

###environment Description
instrument version:1.4.1
###Bug Description
when use Thread.start() ,the OkHttpUtil.httpGet('url') span will be a new trace ,not in the old trace.
###Bug recurrence process

private ExecutorService executorService = new ThreadPoolExecutor(2, 5,
        0L, TimeUnit.MILLISECONDS,
        new LinkedBlockingQueue<Runnable>(1024), new ThreadFactoryBuilder()
        .setNameFormat("yansir-pool-%d").build(), new ThreadPoolExecutor.AbortPolicy());
    //Thread.start() will create a new trace
    new Thread(new ConsumeRunable(id)).start();

    //Thread.run() will continue the old trace,
    new Thread(new ConsumeRunable(id)).run();
    //ThreadPoolExecutor.execute() will continue the old trace,
    executorService.execute(new ConsumeRunable(id));

private class ConsumeRunable implements Runnable{
    private int id;
    public ConsumeRunable(int id) {
        this.id = id;
    }
    @Override
    public void run() {
        OkHttpUtil.httpGet("http://127.0.0.1:9003/b/breceive?id="+id);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions