Skip to content

posting to a shutdown thread pool? #192

@jrochkind

Description

@jrochkind

If you post to a threadpool that is in shutdown? state, your work does not get executed and the call returns false.

What I would have expected instead, is following whatever is the pool's overflow_policy -- raise an exception for :abort, run in caller thread for :caller_runs, and only return without complaining (maybe returning false, sure) for :discard.

But is the present behavior what the java.util.concurrent stuff does? Maybe they have some reason for it, I guess, and I understand wanting to stay consistent. But following the overflow_policy seems more useful and expected to me.

It is surprising to me to have to check the return value of #post to know if the work is actually going to be done, I'd expect an RejectedExcecution exception by default if posting to a shutdown pool (and since overflow_policy is abort by default, that's what I'd get if it followed overflow policy)

Metadata

Metadata

Assignees

Labels

enhancementAdding features, adding tests, improving documentation.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions