Open
Description
Describe the current behavior
- Task Execution Speed: Currently, even simple tasks like a single print statement take more than a second to execute. This occurs even for basic operations that should be near-instantaneous.
- Server Connection Dependency: When using Prefect server for monitoring task execution, if the network connection to the server fails, it affects the execution of tasks and flows on the client-side. The client-side execution is interrupted and shows a connection error, even though we only intend to use the server for monitoring purposes.
Describe the proposed behavior
- Optimized Task Execution: Implement optimizations to reduce the execution time for simple tasks. For instance, a task with a single print statement should complete in milliseconds rather than seconds.
- Fault Tolerance for Server Connection: Introduce a fault-tolerant mode where tasks and flows continue to run locally even if the server connection fails. This could involve:
a) An option to configure the client to continue local execution despite server connection issues.
b) A local caching mechanism to store execution data temporarily when the server is unreachable.
c) An asynchronous reconnection attempt that doesn't block task execution.
Example Use
from prefect import task, flow, get_run_logger
@task(name="Say Hello", task_run_name="task run name")
def say_hello():
logger = get_run_logger()
logger.info("Hello, world----------!")
print("hi")
@flow(name="My First Flow", flow_run_name="flow run name")
def flow():
s = say_hello.submit()
s.result()
# or
say_hello()
flow()
This task takes over a second to complete
Additional context
No response