Skip to content

keepTiKVToImportMode cannot be called after stopKeepTiKVToImportMode #282

@peng1999

Description

@peng1999

What did you do

        TiConfiguration tiConf = TiConfiguration.createDefault("127.0.0.1:2379");
        TiSession tiSession = TiSession.create(tiConf);
        for (int i = 0; i < 2; i++) {
            SwitchTiKVModeClient switchTiKVModeClient = tiSession.getSwitchTiKVModeClient();
            switchTiKVModeClient.keepTiKVToImportMode();
            Thread.sleep(6000);
            switchTiKVModeClient.stopKeepTiKVToImportMode();
            switchTiKVModeClient.switchTiKVToNormalMode();
        }

What happens

Exception in thread "main" java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@37afeb11 rejected from java.util.concurrent.ScheduledThreadPoolExecutor@515aebb0[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]
	at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
	at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:326)
	at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleAtFixedRate(ScheduledThreadPoolExecutor.java:573)
	at java.util.concurrent.Executors$DelegatedScheduledExecutorService.scheduleAtFixedRate(Executors.java:735)
	at org.tikv.common.importer.SwitchTiKVModeClient.keepTiKVToImportMode(SwitchTiKVModeClient.java:59)

Java Client and TiDB/TiKV version info

3.2.0-SNAPSHOT (37506fe)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions