Giter VIP home page Giter VIP logo

Comments (4)

pradovic avatar pradovic commented on June 12, 2024

Hi, may I take this one?

from ockam.

SanjoDeundiak avatar SanjoDeundiak commented on June 12, 2024

@pradovic sure, go ahead

from ockam.

pradovic avatar pradovic commented on June 12, 2024

@SanjoDeundiak Thanks! Finally got the time to take a look.
If I understand correctly the error in processor or worker initialize function error is just logged by WorkerRelay.

#[cfg_attr(not(feature = "std"), allow(unused_mut))]
    #[cfg_attr(not(feature = "std"), allow(unused_variables))]
    async fn run(mut self, mut ctrl_rx: SmallReceiver<CtrlSignal>) {
        match self.worker.initialize(&mut self.ctx).await {
            Ok(()) => {}
            Err(e) => {
                error!(
                    "Failure during '{}' worker initialisation: {}",
                    self.ctx.address(),
                    e
                );
            }
        }

If I understood correctly this does not stop the worker, but just logs the error. The proposed solution would be to move on to the worker shutdown and context stop ack, without starting the loop in between:

 #[cfg_attr(not(feature = "std"), allow(unused_mut))]
    #[cfg_attr(not(feature = "std"), allow(unused_variables))]
    async fn run(mut self, mut ctrl_rx: SmallReceiver<CtrlSignal>) {
        match self.worker.initialize(&mut self.ctx).await {
            Ok(()) => {}
            Err(e) => {
                error!(
                    "Failure during '{}' worker initialisation: {}",
                    self.ctx.address(),
                    e
                );
                
                // call self.shutdown & ctx.send_stop_ack
                shutdown_and_stop_ack(&mut processor, &mut ctx, &ctx_addr).await;
                return;
            }
        }

Processor is behaving in the same fashion, so I posted worker as a reference.

from ockam.

pradovic avatar pradovic commented on June 12, 2024

I have opened the PR with proposed change: #7654. Pls correct me if I am wrong and I will be happy to fix it.

from ockam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.