Skip to content

Cellular: Delete created context if activation fails #12399

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

Merged
merged 1 commit into from
Feb 10, 2020
Merged

Cellular: Delete created context if activation fails #12399

merged 1 commit into from
Feb 10, 2020

Conversation

kivaisan
Copy link
Contributor

Summary of changes

If new context is created but the activation fails to any error, it will
be automatically deleted.

Fixes issue #12381

Impact of changes

Migration actions required

Documentation


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@ARMmbed/mbed-os-wan @jeromecoutant


If new context is created but the activation fails to any error, it will
be automatically deleted.

Fixes issue #12381
@mergify mergify bot added the needs: CI label Feb 10, 2020

err = (_at.get_last_error() == NSAPI_ERROR_OK) ? NSAPI_ERROR_OK : NSAPI_ERROR_NO_CONNECTION;
err = (_at.get_last_error() == NSAPI_ERROR_OK) ? NSAPI_ERROR_OK : NSAPI_ERROR_NO_CONNECTION;
}

// If new PDP context was created and failed to activate, delete it
if (err != NSAPI_ERROR_OK && _new_context_set) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep this _new_context_set condition ?
Ex: A wrong context configuration was already present in modem,
Maybe we should delete all context when connection has failed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should remove contexts not created automatically by cellular. Could it cause problems with devices roaming in different networks? We have "cellular.clear-on-connect" setting which can be (kind of) used to handle this case.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh
Let's try in my mbed_app:

"cellular.clear-on-connect": true

Maybe it can also help @soleilplanet ?

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 10, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Feb 10, 2020

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 added the release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0 label Feb 10, 2020
@0xc0170 0xc0170 merged commit 94e191f into ARMmbed:master Feb 10, 2020
@mergify mergify bot removed the ready for merge label Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants