https://prefect.io logo
Title
m

Matthias

06/05/2020, 4:12 PM
Hi! I am registering a flow like this:
schedule = IntervalSchedule(
            start_date=datetime.utcnow() + timedelta(seconds=1),
            interval=timedelta(hours=1),
        )

        flow.schedule = schedule
        flow.register()
and it works, but after 10 intervals, it simply stops. Where am I wrong?
c

Chris White

06/05/2020, 4:17 PM
Are you running on Windows?
m

Matthias

06/05/2020, 4:18 PM
No, on Linux (in a Docker environment)
c

Chris White

06/05/2020, 4:18 PM
We had a user experience a similar issue recently and it turned out to be an issue with Docker on Windows, not sure if a similar thing applies in your case: https://github.com/PrefectHQ/prefect/issues/2697
m

Matthias

06/05/2020, 4:20 PM
Interesting, seems to be the exact same issue. I’ll have a look if I can derive something from that
c

Chris White

06/05/2020, 4:20 PM
👍 👍
m

Matthias

06/05/2020, 4:40 PM
I did not have the timezones synced and fixed that, but it does not seem to resolve the issue. Also the containers and the host are in sync
DeActivating and Reactivation the Schedule in the UI again creates 10 flow runs
The log of the server does not show anything special
j

josh

06/05/2020, 4:57 PM
@Matthias I believe the scheduler only schedules 10 runs out at a time. Once one runs then another will be added to the pile. If you change your interval schedule’s
interval
to something smaller (like every minute) do you see more runs being scheduled once some get ran?
m

Matthias

06/05/2020, 4:58 PM
Hi @josh, I just did that and it does not add new runs
from datetime import timedelta, datetime
from prefect import task, Flow
from prefect.schedules import IntervalSchedule

@task
def getone():
    return 1

schedule = IntervalSchedule(
    start_date=datetime.utcnow() + timedelta(seconds=1),
    interval=timedelta(minutes=1),
)

with Flow("testflow", schedule=schedule) as flow:
    getone()

flow.register()
c

Chris White

06/05/2020, 4:59 PM
This is definitely some issue with timezones running in your containers, not an issue with your Prefect code which looks fine (e.g., if you registered this flow with Cloud it would behave as you expect)
m

Matthias

06/05/2020, 5:10 PM
Oh crap. I managed to remove the scheduler from the docker-compose file and of course it does not schedule anything
j

josh

06/05/2020, 5:14 PM
😄 Does it seem to be scheduling after readding it?
m

Matthias

06/05/2020, 9:00 PM
Works now just fine 🤦‍♂️
👍 1