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

Infinite loop when receiving unknown data type #7

Closed
emgre opened this issue Jun 30, 2020 · 1 comment
Closed

Infinite loop when receiving unknown data type #7

emgre opened this issue Jun 30, 2020 · 1 comment
Labels
bug Something isn't working master Master issue

Comments

@emgre
Copy link
Contributor

emgre commented Jun 30, 2020

When connecting the dnp3rs master to the OpenDNP3 outstation example, the startup integrity poll fails because it does not expect g50v4 (see #10) in the response, and then retries it immediatly. It creates a loop of request/response. Perhaps it should wait a couple of seconds before retrying that integrity poll.

@emgre emgre added bug Something isn't working master Master issue labels Aug 28, 2020
@emgre emgre changed the title Infinite loop when receiving octet strings Infinite loop when receiving time/interval (g50v4) Sep 4, 2020
@emgre emgre changed the title Infinite loop when receiving time/interval (g50v4) Infinite loop when receiving unknown data type Sep 8, 2020
@emgre
Copy link
Contributor Author

emgre commented Sep 8, 2020

After investigation, the solution would be to modify the AutoTaskState to Failure and avoid re-sending responses. It looks easy to do, however with the current design, the association is never notified of a failure of an AutoTask. Getting notified on failure is hard because we do not have access to the Association and the error may occur before the runner gets the Association

match self
.validate_non_read_response(address, seq, io, reader, writer)
.await
{
// continue reading responses until timeout
Ok(None) => continue,
Ok(Some(response)) => {
match self.associations.get_mut(address) {
Err(x) => {
task.on_task_error(x.into());
return Err(x.into());
}
Ok(association) => {
association.process_iin(response.header.iin);
match task.handle(request_tx, association, response) {
None => return Ok(()),
Some(next) => {
task = next;
// break from the inner loop and execute the next request
break;
}
}
}
}
}
Err(err) => {
task.on_task_error(err);
return Err(err);
}
)

Need to discuss with @jadamcrain

@emgre emgre closed this as completed in 0af752a Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working master Master issue
Projects
None yet
Development

No branches or pull requests

1 participant