riverqueue / river

Fast and reliable background jobs in Go
https://riverqueue.com
Mozilla Public License 2.0
3.59k stars 94 forks source link

Starting the client is stuck #644

Open NikolaySymak opened 1 month ago

NikolaySymak commented 1 month ago

I am running the river on windows, but when start the client, it's stucking. Here are logs that I am getting, but it's still stucking.

My Windows Spec: Windows 11 CPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz(8CPUs), ~3.6GHz RAM: 32gb

@bgentry Can you help me how I can fix it?

time=2024-10-14T09:48:08.873-04:00 level=DEBUG msg="BatchCompleter: Run loop started"
time=2024-10-14T09:48:08.873-04:00 level=DEBUG msg="Notifier: Listener connecting"
time=2024-10-14T09:48:08.873-04:00 level=DEBUG msg="subscriptionManager: Run loop started"
time=2024-10-14T09:48:08.874-04:00 level=DEBUG msg="Notifier: Run loop started"
time=2024-10-14T09:48:08.874-04:00 level=DEBUG msg="Elector: Listening for leadership changes" client_id=desktop-k-asus-windows_2024_10_14T13_48_08_764133 topic=river_leadership
time=2024-10-14T09:48:08.874-04:00 level=DEBUG msg="Notifier: Added subscription" new_num_subscriptions=1 topic=river_leadership
time=2024-10-14T09:48:08.874-04:00 level=DEBUG msg="Notifier: Notifier healthy"
time=2024-10-14T09:48:08.874-04:00 level=DEBUG msg="Notifier: Listening on topic" topic=river_leadership
time=2024-10-14T09:48:08.875-04:00 level=DEBUG msg="Elector: Run loop started"
time=2024-10-14T09:48:08.875-04:00 level=DEBUG msg="producer: Fetching initial queue settings" queue=default
time=2024-10-14T09:48:08.875-04:00 level=DEBUG msg="Client: Election change received" client_id=desktop-k-asus-windows_2024_10_14T13_48_08_764133 is_leader=false
time=2024-10-14T09:48:08.875-04:00 level=DEBUG msg="Elector: Attempting to gain leadership" client_id=desktop-k-asus-windows_2024_10_14T13_48_08_764133
time=2024-10-14T09:48:08.923-04:00 level=DEBUG msg="Elector: Gained leadership" client_id=desktop-k-asus-windows_2024_10_14T13_48_08_764133
time=2024-10-14T09:48:08.923-04:00 level=DEBUG msg="Client: Election change received" client_id=desktop-k-asus-windows_2024_10_14T13_48_08_764133 is_leader=true
time=2024-10-14T09:48:08.924-04:00 level=DEBUG msg="Notifier: Added subscription" new_num_subscriptions=1 topic=river_insert
time=2024-10-14T09:48:09.106-04:00 level=DEBUG msg="QueueCleaner: Run loop started"
time=2024-10-14T09:48:09.787-04:00 level=DEBUG msg="Reindexer: Run loop started"
time=2024-10-14T09:48:09.787-04:00 level=DEBUG msg="Reindexer: Scheduling first run" next_run_at=2024-10-15T00:00:00.000Z
time=2024-10-14T09:48:10.639-04:00 level=DEBUG msg="JobCleaner: Run loop started"
time=2024-10-14T09:48:10.990-04:00 level=DEBUG msg="JobRescuer: Run loop started"
time=2024-10-14T09:48:11.141-04:00 level=DEBUG msg="JobScheduler: Run loop started"
time=2024-10-14T09:48:11.870-04:00 level=DEBUG msg="PeriodicJobEnqueuer: Run loop started"
time=2024-10-14T09:48:13.875-04:00 level=DEBUG msg="Client: Job stats (since last stats line)" num_jobs_run=0 average_complete_duration=0s average_queue_wait_duration=0s average_run_duration=0s
time=2024-10-14T09:48:13.924-04:00 level=DEBUG msg="Elector: Current leader attempting reelect" client_id=desktop-k-asus-windows_2024_10_14T13_48_08_764133
time=2024-10-14T09:48:13.924-04:00 level=DEBUG msg="Notifier: Removed subscription" new_num_subscriptions=0 topic=river_insert
time=2024-10-14T09:48:13.924-04:00 level=DEBUG msg="producer: Stopping"
time=2024-10-14T09:48:13.924-04:00 level=DEBUG msg="producer: Stop returned"
time=2024-10-14T09:48:13.924-04:00 level=DEBUG msg="BatchCompleter: Run loop stopped"
time=2024-10-14T09:48:13.924-04:00 level=DEBUG msg="subscriptionManager: Stopping; distributing subscriptions until channel is closed"
time=2024-10-14T09:48:13.924-04:00 level=DEBUG msg="subscriptionManager: Run loop stopped"
time=2024-10-14T09:48:13.925-04:00 level=DEBUG msg="JobRescuer: Run loop stopped"
time=2024-10-14T09:48:13.925-04:00 level=DEBUG msg="Reindexer: Run loop stopped"
time=2024-10-14T09:48:13.925-04:00 level=DEBUG msg="QueueCleaner: Run loop stopped"
time=2024-10-14T09:48:13.925-04:00 level=DEBUG msg="JobScheduler: Run loop stopped"
time=2024-10-14T09:48:13.925-04:00 level=DEBUG msg="JobCleaner: Run loop stopped"
time=2024-10-14T09:48:13.925-04:00 level=DEBUG msg="PeriodicJobEnqueuer: Run loop stopped"
time=2024-10-14T09:48:13.925-04:00 level=DEBUG msg="Elector: Attempting to resign leadership" client_id=desktop-k-asus-windows_2024_10_14T13_48_08_764133
time=2024-10-14T09:48:13.928-04:00 level=DEBUG msg="Elector: Resigned leadership successfully" client_id=desktop-k-asus-windows_2024_10_14T13_48_08_764133
time=2024-10-14T09:48:13.928-04:00 level=DEBUG msg="Notifier: Listening on topic" topic=river_insert
time=2024-10-14T09:48:18.929-04:00 level=ERROR msg="Notifier: Error unlistening on topic" err="timed out waiting for interrupt operation" topic=river_leadership
time=2024-10-14T09:48:18.929-04:00 level=DEBUG msg="Elector: Run loop stopped"
bgentry commented 1 month ago

It looks like you’re stopping the client, whether by canceling its context or calling Stop on it. Otherwise there is no other trigger for the client to begin a clean shutdown.

I’ll add some debug logging to indicate the cause of shutdown.

NikolaySymak commented 1 month ago

@bgentry thanks for replying with my issue. but I only called client.start(ctx) ,i am not cancelling the context and not stopping it.

same code is working on the mac system, windows system of higher performance devices or other. But it's not working lower performance devices