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

remove_address_record function is called two times per Address during Processor shutdown #7401

Open
SanjoDeundiak opened this issue Jan 11, 2024 · 3 comments

Comments

@SanjoDeundiak
Copy link
Member

SanjoDeundiak commented Jan 11, 2024

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 SanjoDeundiak changed the title free_address function is called two times per Address during Processor shutdown remove_address_record function is called two times per Address during Processor shutdown Jan 11, 2024
@danik292
Copy link

Hello can I work for it?

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

@SanjoDeundiak
Copy link
Member Author

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

@danik292
Copy link

Thank you☺️
@SanjoDeundiak

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

No branches or pull requests

2 participants