Ask Your Question

Custom origin having Java ScheduledExecutorService do not stop in background even if Pipeline is stopped

asked 2018-10-22 05:55:59 -0500

Hi ,

I have developed Custom origin Scheduler , which uses JAVA ScheduledExecutorService to provide different information in different intervals periodically.

It works good but when during execution we are facing 2 problems

1- [Major ] Executor service remains running in background even when i do Force Stop Pipeline

2- When i do stop it remains in stopping mode and i need to go for force stop

I used solutions : 1- Stopping executor service forcefully in @destroy method but during Force stop I don't think destroy method is called as i can not see in logs.

Can some one please help me regarding this?

When we do forcestop which method is ideally called if I am implementing BasePushSource.

Regards, Ankit

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-10-26 11:19:49 -0500

jeff gravatar image

If implementing a push source, you need to check whether the context is stopped in the main loop. See the TCP server source for an example. This is the normal, clean (not forced) stop. You simply allow control to exit your produce method once the context is stopped. Force stop will just interrupt your produce method and you don't have any control over hooking into that (by design).

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-10-22 05:35:57 -0500

Seen: 645 times

Last updated: Oct 26 '18