Skip to content

Cellular: retry logic for CellularContext connect #10056

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
Apr 1, 2019

Conversation

jarvte
Copy link
Contributor

@jarvte jarvte commented Mar 12, 2019

Description

State machine has retry logic until device is attached to network.
After this CellularContext does the context activation e.g. connect.
There was no retry logic for context activation. Added logic to
CellularContext level so it's available for at and (upcoming) ril layers.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@AriParkkila

Release Notes

Add retry logic for CellularContext connect last phase: activating pdp context / open ppp channel.
Retry logic is the same as in CellularStateMachine.

@ciarmcom ciarmcom requested review from AriParkkila and a team March 12, 2019 14:00
@ciarmcom
Copy link
Member

@jarvte, thank you for your changes.
@AriParkkila @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-wan @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 13, 2019

Added retry logic for CellularContext connect last phase: activating pdp context / open ppp channel.

Is this still considered a fix rather than adding new functionality (new method to cellularcontext) as result it will fix as well.

*/
void call_network_cb(nsapi_connection_status_t status);

virtual void do_connect() = 0;

Choose a reason for hiding this comment

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

This is an API break!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are protected methods and already implemented in AT_CellularContext class (exepct do_connect_with_retry). This was done so that RIL and AT layers don't have copy-paste code. So is this kind of change also prohibited?

Choose a reason for hiding this comment

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

Pure virtual will cause code changes, while a function with a default implementation will not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, if I change this to not pure virtual but virtual it's accepted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed fix to virtual method with default implementation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pushed fix. Now there is a default implementation in place.

Copy link

@AnttiKauppila AnttiKauppila left a comment

Choose a reason for hiding this comment

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

Why a new API break introduced?

@jarvte
Copy link
Contributor Author

jarvte commented Mar 13, 2019

Why a new API break introduced?

see my response to your other comment

Copy link
Contributor

@SeppoTakalo SeppoTakalo left a comment

Choose a reason for hiding this comment

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

These are internal APIs.
I have no objection from IP Core point of view. Needs Cellular tech-lead to approve.

@@ -106,6 +112,11 @@ void AT_CellularContext::enable_hup(bool enable)
}
}

void AT_CellularContext::do_connect_with_retry()
{
CellularContext::do_connect_with_retry();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you override if you just directly call the base?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's because of EventQueue. In non blocking mode we use EventQueue to call do_connect_with_retry. We can't call CellularContext::do_connect_with_retry() as it's protected so to avoid that problem we had to introduce this function.

@jarvte jarvte force-pushed the context_act_ppp_retry_logic branch from 00b85ef to 5626df9 Compare March 13, 2019 14:34
@jarvte
Copy link
Contributor Author

jarvte commented Mar 14, 2019

Added retry logic for CellularContext connect last phase: activating pdp context / open ppp channel.

Is this still considered a fix rather than adding new functionality (new method to cellularcontext) as result it will fix as well.

New method is a protected method but I'm fine with fix or functionality change. I really don't know which would suite better.

@jarvte jarvte force-pushed the context_act_ppp_retry_logic branch from 5626df9 to 8e58962 Compare March 14, 2019 08:22
@jarvte
Copy link
Contributor Author

jarvte commented Mar 14, 2019

Force pushed doxygen updates.

@jarvte
Copy link
Contributor Author

jarvte commented Mar 27, 2019

ping

@cmonr
Copy link
Contributor

cmonr commented Mar 27, 2019

@ARMmbed/mbed-os-wan Please re-review.

@jarvte jarvte force-pushed the context_act_ppp_retry_logic branch from 8e58962 to b4b7128 Compare March 29, 2019 06:01
@jarvte
Copy link
Contributor Author

jarvte commented Mar 29, 2019

Force pushed rebase with master to fix conflicts.

State machine has retry logic until device is attached to network.
After this CellularContext does the context activation e.g. connect.
There was no retry logic for context activation. Added logic to
CellularContext level so it's available for at and (upcoming)ril layers.
@cmonr
Copy link
Contributor

cmonr commented Mar 29, 2019

Info: This PR has now been rebased.

If this was made in error, feel free to force-push your local branch to restore the PR.

@cmonr cmonr force-pushed the context_act_ppp_retry_logic branch from b4b7128 to c6e5595 Compare March 29, 2019 19:12
@cmonr
Copy link
Contributor

cmonr commented Mar 29, 2019

CI started

@cmonr
Copy link
Contributor

cmonr commented Mar 29, 2019

@jarvte Rebased your PR since a seperate PR fixed the astyle issues.

@mbed-ci
Copy link

mbed-ci commented Mar 29, 2019

Test run: FAILED

Summary: 2 of 13 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test
  • jenkins-ci/mbed-os-ci_exporter

@NirSonnenschein
Copy link
Contributor

Failures seem to be CI K66 issue +license issue. restarting CI

@mbed-ci
Copy link

mbed-ci commented Mar 31, 2019

Test run: FAILED

Summary: 1 of 13 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test

@jarvte
Copy link
Contributor Author

jarvte commented Apr 1, 2019

Still K66F failing, not related to this pr.

@alekla01
Copy link
Contributor

alekla01 commented Apr 1, 2019

restarted jenkins-ci/mbed-os-ci_greentea-test

@mbed-ci
Copy link

mbed-ci commented Apr 1, 2019

Test run: SUCCESS

Summary: 13 of 13 test jobs passed
Build number : 3
Build artifacts

@cmonr cmonr merged commit cf4118f into ARMmbed:master Apr 1, 2019
@jarvte jarvte deleted the context_act_ppp_retry_logic branch April 5, 2019 10:20
@0xc0170
Copy link
Contributor

0xc0170 commented Apr 5, 2019

@jarvte Need help with this fix. Patching this causing multiple conflicts that are not that easy to resolve - too many changes on master landing to these files? Need a branch against release-candidate branch (already having 5.12.1rc ready, just waiting for this one to land).

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 5, 2019

Or will go to 5.12.2 with new PR targeting 5.12 branch

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 5, 2019

Moving to 5.12.2 (if wont be manually patched for 5.12.1).

@cmonr
Copy link
Contributor

cmonr commented Apr 9, 2019

Moving to 5.13.0-rc1.

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

Successfully merging this pull request may close these issues.

10 participants