cpython icon indicating copy to clipboard operation
cpython copied to clipboard

Provide a rejected execution model and implementations for futures.

Open d13f0d4a-d7b9-4a53-b145-327702474f5e opened this issue 11 years ago • 1 comments

BPO 22737
Nosy @brianquinlan, @vstinner

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2014-10-27.02:38:59.425>
labels = ['type-feature', 'library']
title = 'Provide a rejected execution model and implementations for futures.'
updated_at = <Date 2015-07-24.12:43:45.192>
user = 'https://bugs.python.org/JoshuaHarlow'

bugs.python.org fields:

activity = <Date 2015-07-24.12:43:45.192>
actor = 'sileht'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2014-10-27.02:38:59.425>
creator = 'Joshua.Harlow'
dependencies = []
files = []
hgrepos = []
issue_num = 22737
keywords = []
message_count = 1.0
messages = ['230058']
nosy_count = 4.0
nosy_names = ['bquinlan', 'vstinner', 'Joshua.Harlow', 'sileht']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue22737'
versions = ['Python 3.5']

When a future can't be accepted by an executor that it is has been submitted to it would be really nice to throw have a type of 'RejectedExecutionException' (this is the name the java folks have used) to denote that the executors policy does not allow for further execution.

Some of the reasons that further execution could be rejected (an arbitrary executor policy would be really neat).

  • Backlog of work to be done has reached a configurable threshold.
  • Resource limits reached (in concept similar to a 503 HTTP error code), come back later...

This would be a great addition to allow for executor usage that does not cause resource starvation (currently executors have unbounded work queues, which is undesirable under load where a rejected execution error would be more appropriate to avoid more starvation...)

Closing as it is very old and no comments after the initial post.

kumaraditya303 avatar Nov 10 '22 16:11 kumaraditya303