Hi, look like the retry delay in task was neevr im...
# prefect-contributors-archived
f
Hi, look like the retry delay in task was neevr implemented
n
hi @flapili - which version of prefect are you using?
retry_delay_seconds
should be what you want here
Copy code
In [1]: from prefect import flow, task

In [2]: import time
   ...:
   ...: @flow
   ...: def f():
   ...:     @task(retries=1, retry_delay_seconds=10)
   ...:     def foo():
   ...:         raise ValueError
   ...:     t = time.monotonic()
   ...:     state = foo(return_state=True)
   ...:     assert state.is_failed()
   ...:     assert (delta := time.monotonic() - t) > 10, f"got {delta}"
   ...:     return "successfully failed"
   ...:

In [3]: f()
....
14:38:18.505 | ERROR   | Task run 'foo-0' - Finished in state Failed('Task run encountered an exception ValueError: ')
14:38:18.683 | INFO    | Flow run 'gigantic-myna' - Finished in state Completed()
Out[4]: 'successfully failed'
In [5]: !prefect version
Version:             2.19.3+6.g9c584e88a6
f
tried with both latest 2 and rc 3
n
ahh I see - thanks for trying the rc! I'll make sure we'll get that added - thank you for raising this!
so to answer your other question, we would definitely accept this if you wanted to make a contribution do you think you will? otherwise ill go ahead and do that now
latest 2.x should already have it though
I did another threads before asking here if I could impl this
n
ah i see - thank you!
f
I did a simple monkey patch but I dont know too much the core of prefect
latest 2.x should already have it though
I believe I already add this issue like few years ago
but it was the beta of v2
n
gotcha, yeah nowadays
retry_delay_seconds
should be supported in 2.x (like in my example above) but we accidentally dropped it when rewriting the engine (the RC version) and so we'll add it back!
f
well, I'll try to make a proper impl but I'll for sure not be able to make correct test case
just to be sure, what version of python should I use ?
n
in 2.x we support 3.8-3.12 and in the rc we dropped 3.8
f
ok so it''s not due to 3.12
👍 1
Copy code
22:01:47.321 | ERROR   | asyncio - Exception in callback SubprocessStreamProtocol.pipe_data_received(2, b'Traceback (...arted\r\n\r\n')
handle: <Handle SubprocessStreamProtocol.pipe_data_received(2, b'Traceback (...arted\r\n\r\n')>
Traceback (most recent call last):
  File "C:\Users\admin\.rye\py\cpython@3.12.2\install\Lib\asyncio\events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\admin\.rye\py\cpython@3.12.2\install\Lib\asyncio\subprocess.py", line 72, in pipe_data_received
    reader.feed_data(data)
  File "C:\Users\admin\.rye\py\cpython@3.12.2\install\Lib\asyncio\streams.py", line 500, in feed_data
    assert not self._eof, 'feed_data after feed_eof'
AssertionError: feed_data after feed_eof
22:01:47.325 | ERROR   | asyncio - Exception in callback SubprocessStreamProtocol.pipe_data_received(2, b'Application... Exiting.\r\n')
handle: <Handle SubprocessStreamProtocol.pipe_data_received(2, b'Application... Exiting.\r\n')>
Traceback (most recent call last):
  File "C:\Users\admin\.rye\py\cpython@3.12.2\install\Lib\asyncio\events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\admin\.rye\py\cpython@3.12.2\install\Lib\asyncio\subprocess.py", line 72, in pipe_data_received
    reader.feed_data(data)
  File "C:\Users\admin\.rye\py\cpython@3.12.2\install\Lib\asyncio\streams.py", line 500, in feed_data
    assert not self._eof, 'feed_data after feed_eof'
AssertionError: feed_data after feed_eof
bunch of errors with dev start
ok, it was due to a server process already on port 4200, but the weird things is this server was stopped long time ago
look like in rc3.0 process are not exited correctly (al least on windows)
I had to kill an orphean python process which was not running in any terminal