import time
import parsl
from parsl.app.app import python_app
from parsl.configs.htex_local import config
config.executors[0].max_workers = 1
from coffea.processor.parsl.timeout import timeout
parsl.set_stream_logger()
parsl.load(config)
@python_app
@timeout
def sleep(seconds, timeout=None):
import time
time.sleep(seconds)
return 'slept {} seconds'.format(seconds)
futures = [sleep(i, timeout=2) for i in [1, 3, 1]]
for f in futures:
try:
print('*' * 50 + ' FIRST BATCH: ' + f.result())
except Exception as e:
print('caught exception: {}'.format(e))
# comment out to see expected behavior
time.sleep(5)
futures = [sleep(i, timeout=2) for i in [1, 1]]
for f in futures:
print('*' * 50 + ' SECOND BATCH: ' + f.result())
2019-06-28 19:18:14 parsl.dataflow.dflow:464 [INFO] Task 0 launched on executor htex_local
2019-06-28 19:18:14 parsl.dataflow.dflow:688 [INFO] Task 1 submitted for App sleep, waiting on tasks []
2019-06-28 19:18:14 parsl.dataflow.dflow:698 [DEBUG] Task 1 set to pending state with AppFuture: <AppFuture super=<AppFuture at 0x7f074d01c5f8 state=pending> parent=None>
2019-06-28 19:18:14 parsl.executors.high_throughput.executor:514 [DEBUG] Pushing function <function sleep at 0x7f074d020378> to queue with args (3,)
2019-06-28 19:18:14 parsl.dataflow.dflow:464 [INFO] Task 1 launched on executor htex_local
2019-06-28 19:18:14 parsl.dataflow.dflow:688 [INFO] Task 2 submitted for App sleep, waiting on tasks []
2019-06-28 19:18:14 parsl.dataflow.dflow:698 [DEBUG] Task 2 set to pending state with AppFuture: <AppFuture super=<AppFuture at 0x7f074d01c940 state=pending> parent=None>
2019-06-28 19:18:14 parsl.executors.high_throughput.executor:514 [DEBUG] Pushing function <function sleep at 0x7f074d020378> to queue with args (1,)
2019-06-28 19:18:14 parsl.dataflow.dflow:464 [INFO] Task 2 launched on executor htex_local
2019-06-28 19:18:15 parsl.providers.local.local:92 [DEBUG] Checking status of: [3841105]
2019-06-28 19:18:15 parsl.dataflow.strategy:204 [DEBUG] Executor htex_local has 3 active tasks, 1/0/0 running/submitted/pending blocks, and 0 connected workers
2019-06-28 19:18:18 parsl.dataflow.dflow:280 [INFO] Task 0 completed
************************************************** FIRST BATCH: slept 1 seconds
2019-06-28 19:18:20 parsl.providers.local.local:92 [DEBUG] Checking status of: [3841105]
2019-06-28 19:18:20 parsl.dataflow.strategy:204 [DEBUG] Executor htex_local has 2 active tasks, 1/0/0 running/submitted/pending blocks, and 1 connected workers
2019-06-28 19:18:20 parsl.app.errors:158 [DEBUG] Reraising exception of type <class 'Exception'>
2019-06-28 19:18:20 parsl.dataflow.dflow:250 [ERROR] Task 1 failed
Traceback (most recent call last):
File "/afs/hep.wisc.edu/home/awoodard/.local/lib/python3.6/site-packages/parsl-0.8.0-py3.6.egg/parsl/dataflow/dflow.py", line 247, in handle_exec_update
res.reraise()
File "/afs/hep.wisc.edu/home/awoodard/.local/lib/python3.6/site-packages/parsl-0.8.0-py3.6.egg/parsl/app/errors.py", line 163, in reraise
reraise(t, v, tb)
File "/cvmfs/sft.cern.ch/lcg/views/LCG_95apython3/x86_64-centos7-gcc7-opt/lib/python3.6/site-packages/six.py", line 692, in reraise
raise value.with_traceback(tb)
File "/afs/hep.wisc.edu/home/awoodard/.local/lib/python3.6/site-packages/parsl-0.8.0-py3.6.egg/parsl/app/errors.py", line 172, in wrapper
return func(*args, **kwargs)
File "/afs/hep.wisc.edu/user/awoodard/coffea/coffea/processor/parsl/timeout.py", line 23, in wrapper
retval = func(*args, **kwargs)
File "test.py", line 17, in sleep
time.sleep(seconds)
File "/afs/hep.wisc.edu/user/awoodard/coffea/coffea/processor/parsl/timeout.py", line 15, in _timeout_handler
raise Exception("Timeout hit")
Exception: Timeout hit
2019-06-28 19:18:20 parsl.dataflow.dflow:271 [INFO] Task 1 failed after 0 retry attempts
2019-06-28 19:18:20 parsl.app.errors:158 [DEBUG] Reraising exception of type <class 'Exception'>
caught exception: Timeout hit
2019-06-28 19:18:22 parsl.dataflow.dflow:280 [INFO] Task 2 completed
************************************************** FIRST BATCH: slept 1 seconds
2019-06-28 19:18:22 parsl.dataflow.dflow:688 [INFO] Task 3 submitted for App sleep, waiting on tasks []
2019-06-28 19:18:22 parsl.dataflow.dflow:698 [DEBUG] Task 3 set to pending state with AppFuture: <AppFuture super=<AppFuture at 0x7f074d01ce10 state=pending> parent=None>
2019-06-28 19:18:22 parsl.executors.high_throughput.executor:514 [DEBUG] Pushing function <function sleep at 0x7f074d020378> to queue with args (1,)
2019-06-28 19:18:22 parsl.dataflow.dflow:464 [INFO] Task 3 launched on executor htex_local
2019-06-28 19:18:22 parsl.dataflow.dflow:688 [INFO] Task 4 submitted for App sleep, waiting on tasks []
2019-06-28 19:18:22 parsl.dataflow.dflow:698 [DEBUG] Task 4 set to pending state with AppFuture: <AppFuture super=<AppFuture at 0x7f074d02d828 state=pending> parent=None>
2019-06-28 19:18:22 parsl.executors.high_throughput.executor:514 [DEBUG] Pushing function <function sleep at 0x7f074d020378> to queue with args (1,)
2019-06-28 19:18:22 parsl.dataflow.dflow:464 [INFO] Task 4 launched on executor htex_local
2019-06-28 19:18:23 parsl.dataflow.dflow:280 [INFO] Task 3 completed
************************************************** SECOND BATCH: slept 1 seconds
2019-06-28 19:18:25 parsl.dataflow.dflow:280 [INFO] Task 4 completed
************************************************** SECOND BATCH: slept 1 seconds
2019-06-28 19:18:25 parsl.dataflow.dflow:823 [INFO] DFK cleanup initiated
2019-06-28 19:18:25 parsl.dataflow.dflow:734 [INFO] Summary of tasks in DFK:
2019-06-28 19:18:25 parsl.dataflow.dflow:765 [INFO] Tasks in state States.done: 0, 2, 3, 4
2019-06-28 19:18:25 parsl.dataflow.dflow:765 [INFO] Tasks in state States.failed: 1
2019-06-28 19:18:25 parsl.dataflow.dflow:772 [INFO] End of summary
2019-06-28 19:18:25 parsl.dataflow.dflow:847 [INFO] Terminating flow_control and strategy threads
2019-06-28 19:18:25 parsl.executors.high_throughput.executor:484 [DEBUG] [HOLD_BLOCK]: Sending hold to manager: 51fc0f805958
2019-06-28 19:18:25 parsl.executors.high_throughput.executor:452 [DEBUG] Sent hold request to worker: 51fc0f805958
2019-06-28 19:18:25 parsl.providers.local.local:235 [DEBUG] Terminating job/proc_id: 3841105
2019-06-28 19:18:25 parsl.executors.high_throughput.executor:618 [INFO] Attempting HighThroughputExecutor shutdown
2019-06-28 19:18:25 parsl.executors.high_throughput.executor:622 [INFO] Finished HighThroughputExecutor shutdown attempt
2019-06-28 19:18:25 parsl.data_provider.data_manager:98 [DEBUG] Done with executor shutdown
2019-06-28 19:18:25 parsl.dataflow.dflow:879 [INFO] DFK cleanup complete
2019-06-28 19:20:49 parsl.dataflow.dflow:464 [INFO] Task 0 launched on executor htex_local
2019-06-28 19:20:49 parsl.dataflow.dflow:688 [INFO] Task 1 submitted for App sleep, waiting on tasks []
2019-06-28 19:20:49 parsl.dataflow.dflow:698 [DEBUG] Task 1 set to pending state with AppFuture: <AppFuture super=<AppFuture at 0x7f7f8003d5c0 state=pending> parent=None>
2019-06-28 19:20:49 parsl.executors.high_throughput.executor:514 [DEBUG] Pushing function <function sleep at 0x7f7f80041378> to queue with args (3,)
2019-06-28 19:20:49 parsl.dataflow.dflow:464 [INFO] Task 1 launched on executor htex_local
2019-06-28 19:20:49 parsl.dataflow.dflow:688 [INFO] Task 2 submitted for App sleep, waiting on tasks []
2019-06-28 19:20:49 parsl.dataflow.dflow:698 [DEBUG] Task 2 set to pending state with AppFuture: <AppFuture super=<AppFuture at 0x7f7f8003d908 state=pending> parent=None>
2019-06-28 19:20:49 parsl.executors.high_throughput.executor:514 [DEBUG] Pushing function <function sleep at 0x7f7f80041378> to queue with args (1,)
2019-06-28 19:20:49 parsl.dataflow.dflow:464 [INFO] Task 2 launched on executor htex_local
2019-06-28 19:20:50 parsl.providers.local.local:92 [DEBUG] Checking status of: [3842571]
2019-06-28 19:20:50 parsl.dataflow.strategy:204 [DEBUG] Executor htex_local has 3 active tasks, 1/0/0 running/submitted/pending blocks, and 0 connected workers
2019-06-28 19:20:53 parsl.dataflow.dflow:280 [INFO] Task 0 completed
************************************************** FIRST BATCH: slept 1 seconds
2019-06-28 19:20:55 parsl.providers.local.local:92 [DEBUG] Checking status of: [3842571]
2019-06-28 19:20:55 parsl.dataflow.strategy:204 [DEBUG] Executor htex_local has 2 active tasks, 1/0/0 running/submitted/pending blocks, and 1 connected workers
2019-06-28 19:20:55 parsl.app.errors:158 [DEBUG] Reraising exception of type <class 'Exception'>
2019-06-28 19:20:55 parsl.dataflow.dflow:250 [ERROR] Task 1 failed
Traceback (most recent call last):
File "/afs/hep.wisc.edu/home/awoodard/.local/lib/python3.6/site-packages/parsl-0.8.0-py3.6.egg/parsl/dataflow/dflow.py", line 247, in handle_exec_update
res.reraise()
File "/afs/hep.wisc.edu/home/awoodard/.local/lib/python3.6/site-packages/parsl-0.8.0-py3.6.egg/parsl/app/errors.py", line 163, in reraise
reraise(t, v, tb)
File "/cvmfs/sft.cern.ch/lcg/views/LCG_95apython3/x86_64-centos7-gcc7-opt/lib/python3.6/site-packages/six.py", line 692, in reraise
raise value.with_traceback(tb)
File "/afs/hep.wisc.edu/home/awoodard/.local/lib/python3.6/site-packages/parsl-0.8.0-py3.6.egg/parsl/app/errors.py", line 172, in wrapper
return func(*args, **kwargs)
File "/afs/hep.wisc.edu/user/awoodard/coffea/coffea/processor/parsl/timeout.py", line 23, in wrapper
retval = func(*args, **kwargs)
File "test.py", line 17, in sleep
time.sleep(seconds)
File "/afs/hep.wisc.edu/user/awoodard/coffea/coffea/processor/parsl/timeout.py", line 15, in _timeout_handler
raise Exception("Timeout hit")
Exception: Timeout hit
2019-06-28 19:20:55 parsl.dataflow.dflow:271 [INFO] Task 1 failed after 0 retry attempts
2019-06-28 19:20:55 parsl.app.errors:158 [DEBUG] Reraising exception of type <class 'Exception'>
caught exception: Timeout hit
2019-06-28 19:20:57 parsl.dataflow.dflow:280 [INFO] Task 2 completed
************************************************** FIRST BATCH: slept 1 seconds
2019-06-28 19:21:00 parsl.providers.local.local:92 [DEBUG] Checking status of: [3842571]
2019-06-28 19:21:00 parsl.dataflow.strategy:204 [DEBUG] Executor htex_local has 0 active tasks, 1/0/0 running/submitted/pending blocks, and 1 connected workers
2019-06-28 19:21:00 parsl.dataflow.strategy:230 [DEBUG] Executor htex_local has 0 active tasks; starting kill timer (if idle time exceeds 120s, resources will be removed)
2019-06-28 19:21:02 parsl.dataflow.dflow:688 [INFO] Task 3 submitted for App sleep, waiting on tasks []
2019-06-28 19:21:02 parsl.dataflow.dflow:698 [DEBUG] Task 3 set to pending state with AppFuture: <AppFuture super=<AppFuture at 0x7f7f8003ddd8 state=pending> parent=None>
2019-06-28 19:21:02 parsl.executors.high_throughput.executor:514 [DEBUG] Pushing function <function sleep at 0x7f7f80041378> to queue with args (1,)
2019-06-28 19:21:02 parsl.dataflow.dflow:464 [INFO] Task 3 launched on executor htex_local
2019-06-28 19:21:02 parsl.dataflow.dflow:688 [INFO] Task 4 submitted for App sleep, waiting on tasks []
2019-06-28 19:21:02 parsl.dataflow.dflow:698 [DEBUG] Task 4 set to pending state with AppFuture: <AppFuture super=<AppFuture at 0x7f7f8004e7f0 state=pending> parent=None>
2019-06-28 19:21:02 parsl.executors.high_throughput.executor:514 [DEBUG] Pushing function <function sleep at 0x7f7f80041378> to queue with args (1,)
2019-06-28 19:21:02 parsl.dataflow.dflow:464 [INFO] Task 4 launched on executor htex_local
2019-06-28 19:21:05 parsl.providers.local.local:92 [DEBUG] Checking status of: [3842571]
2019-06-28 19:21:05 parsl.dataflow.strategy:204 [DEBUG] Executor htex_local has 2 active tasks, 1/0/0 running/submitted/pending blocks, and 1 connected workers
2019-06-28 19:21:10 parsl.providers.local.local:92 [DEBUG] Checking status of: [3842571]
2019-06-28 19:21:10 parsl.dataflow.strategy:204 [DEBUG] Executor htex_local has 2 active tasks, 1/0/0 running/submitted/pending blocks, and 1 connected workers
2019-06-28 19:21:15 parsl.providers.local.local:92 [DEBUG] Checking status of: [3842571]
2019-06-28 19:21:15 parsl.dataflow.strategy:204 [DEBUG] Executor htex_local has 2 active tasks, 1/0/0 running/submitted/pending blocks, and 1 connected workers
2019-06-28 19:21:20 parsl.providers.local.local:92 [DEBUG] Checking status of: [3842571]
2019-06-28 19:21:20 parsl.dataflow.strategy:204 [DEBUG] Executor htex_local has 2 active tasks, 1/0/0 running/submitted/pending blocks, and 1 connected workers
2019-06-28 19:21:25 parsl.providers.local.local:92 [DEBUG] Checking status of: [3842571]
2019-06-28 19:21:25 parsl.dataflow.strategy:204 [DEBUG] Executor htex_local has 2 active tasks, 1/0/0 running/submitted/pending blocks, and 1 connected workers
[ad infinitum]
awoodard 3802394 0.3 0.0 0 0 pts/20 Z 18:54 0:00 [process_worker_] <defunct>