Framework: clean up resources after task calls Exit()

I don't know whether it is more go if we define epochStop as chan struct{}?