Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Futures are not marked as completed #66098

Closed
SebastianKreftDeezer mannequin opened this issue Jul 1, 2014 · 2 comments
Closed

Futures are not marked as completed #66098

SebastianKreftDeezer mannequin opened this issue Jul 1, 2014 · 2 comments

Comments

@SebastianKreftDeezer
Copy link
Mannequin

SebastianKreftDeezer mannequin commented Jul 1, 2014

BPO 21899

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 = <Date 2014-07-16.14:56:39.762>
created_at = <Date 2014-07-01.14:29:26.987>
labels = []
title = 'Futures are not marked as completed'
updated_at = <Date 2014-07-16.14:56:39.735>
user = 'https://bugs.python.org/SebastianKreftDeezer'

bugs.python.org fields:

activity = <Date 2014-07-16.14:56:39.735>
actor = 'Sebastian.Kreft.Deezer'
assignee = 'none'
closed = True
closed_date = <Date 2014-07-16.14:56:39.762>
closer = 'Sebastian.Kreft.Deezer'
components = []
creation = <Date 2014-07-01.14:29:26.987>
creator = 'Sebastian.Kreft.Deezer'
dependencies = []
files = []
hgrepos = []
issue_num = 21899
keywords = []
message_count = 2.0
messages = ['222034', '223218']
nosy_count = 1.0
nosy_names = ['Sebastian.Kreft.Deezer']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue21899'
versions = []

@SebastianKreftDeezer
Copy link
Mannequin Author

SebastianKreftDeezer mannequin commented Jul 1, 2014

With Python 3.4.1 compiled from source, I'm having an issue in which every now and then some Futures are not marked as completed even though the underlying workload is done.

My workload is launching two subprocess in parallel, and whenever one is ready, launches another one. In one of the runs, the whole process got stuck after launching about 3K subprocess, and the underlying processes had in fact finished.

To wait for the finished subprocesses, I'm using FIRST_COMPLETED. Below is the core of my workload:

for element in element_generator:
    while len(running) >= max_tasks:
        done, pending = concurrent.futures.wait(running, timeout=15.0, return_when=concurrent.futures.FIRST_COMPLETED)
        process_results(done)
        running = pending

    running.add(executor.submit(exe_subprocess, element)) 
 

Replicating the issue takes time, but I've been able to successfully reproduce it with 2 and 3 processes in parallel.

Note: this was already posted in comments to http://bugs.python.org/issue20319, however it did not receive the proper atention as that issue is already closed.

As suggested there I printed the status of the never finished futures and this is the result:

State: RUNNING, Result: None, Exception: None, Waiters: 0, Cancelled: False, Running: True, Done: False

The information does not seem very relevant. However, I can attach a console and debug from there.

@SebastianKreftDeezer
Copy link
Mannequin Author

SebastianKreftDeezer mannequin commented Jul 16, 2014

After more testing I finally found that in fact the process is not being killed. That means that there is no problem with the futures. But instead it is probably related with subprocess deadlocking, as the problematic process does not consume any CPU.

Sorry for the false report.

@SebastianKreftDeezer SebastianKreftDeezer mannequin closed this as completed Jul 16, 2014
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants