Skip to content
This repository was archived by the owner on Aug 18, 2023. It is now read-only.
This repository was archived by the owner on Aug 18, 2023. It is now read-only.

this is has a bug:"shutDown" invalidates "timeOut"; #1

@catkins10

Description

@catkins10

hello ,rynffoll

`static ThreadPoolTimeoutExecutor timeoutExecutor = new ThreadPoolTimeoutExecutor(
1000*1,10,20,60, TimeUnit.SECONDS,
new LinkedBlockingQueue(10)
);

public static void main(String [] argws){
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    for(int i=0;i<1;i++){
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                System.out.println("start Time :"+format.format(new Date()));
                try {
                    Thread.sleep(1000*10);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println(" end Time :"+format.format(new Date()));
            }
        };
        timeoutExecutor.submit(runnable);
    }
    timeoutExecutor.shutdown();
}`

when "timeoutExecutor.shutdown()", "supervisorThreadPool" does not have a task and will immediately "shutdown","shutDown" invalidates "timeOut";

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions