Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tick send error SendError(true) after a while #35

Open
jukanntenn opened this issue Oct 22, 2022 · 1 comment
Open

Tick send error SendError(true) after a while #35

jukanntenn opened this issue Oct 22, 2022 · 1 comment

Comments

@jukanntenn
Copy link

I have an application using tokio-cron-scheduler. However, after the application starting and running for a while, the cron scheduler no longer work and print Tick send error SendError(true) to the console every 500ms.

I did some investigation on it, here is the source code where produce the error:

loop {
        if let Err(e) = tx.send(true) {
            let shutdown = { *(shutdown.read().await) };
            if shutdown {
                return;
            }
            error!("Tick send error {:?}", e);
        }
        tokio::time::sleep(Duration::from_millis(500)).await;
    }

tokio::sync::broadcast::Sender documentation says

An unsuccessful send would be one where all associated [Receiver] handles have already been dropped.

I have no idea why this occurs. Would you please provide some hints or suggestions for how to debug this error? Since my application is a little complex, so I'm sorry that I can't provide a minimal example to reproduce the issue.

Thanks a lot!

@mvniekerk
Copy link
Owner

Hi @jukanntenn
Yes, an MPSC receiver channel was dropped somewhere causing this. Can be that your job scheduler variable ran out of scope. It is a bit hard to debug without the code though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants