ockam icon indicating copy to clipboard operation
ockam copied to clipboard

`remove_address_record` function is called two times per Address during Processor shutdown

Open SanjoDeundiak opened this issue 1 year ago • 3 comments

Observed behavior

remove_address_record is called two times for the same Address

Steps to reproduce

use core::time::Duration;
use ockam_core::async_trait;
use ockam_core::{Processor, Result};
use ockam_node::Context;

#[ockam_macros::test]
async fn starting_processor(ctx: &mut Context) -> Result<()> {
    ctx.start_processor("dummy_processor", DummyProcessor)
        .await?;
    ctx.sleep(Duration::from_secs(1)).await;
    ctx.stop_processor("dummy_processor").await?;

    ctx.sleep(Duration::from_secs(1)).await;
    ctx.stop().await
}

struct DummyProcessor;

#[async_trait]
impl Processor for DummyProcessor {
    type Context = Context;

    async fn process(&mut self, _ctx: &mut Context) -> Result<bool> {
        Ok(true)
    }
}

Desired behavior

Each address should in the system should have clear lifecycle. It should be removed only once

Ockam Version

0.116.0

SanjoDeundiak avatar Jan 11 '24 11:01 SanjoDeundiak

Hello can I work for it?

But I need to know where is relevant code located @SanjoDeundiak

danik292 avatar Jan 23 '24 09:01 danik292

Sure @danik292 , go ahead! Most of the source code you'll need to touch must be in ockam_node/src/router directory. The tricky part of that issue is that access to the address map happens from different places/different source files/at different point of an address lifecycle. So could take a while to untangle

SanjoDeundiak avatar Jan 23 '24 10:01 SanjoDeundiak

Thank you☺️ @SanjoDeundiak

danik292 avatar Jan 24 '24 10:01 danik292