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

MYNEWT-774 Serial errors in newtmgr messages #323

Merged
merged 1 commit into from
Jun 8, 2017

Conversation

ccollins476ad
Copy link
Contributor

Using the nmgr_shell transport (newtmgr over shell), some incoming commands get dropped. The problem seems to be caused by an exhaustion of shell events. By default, the shell only allocates a single event.

The sequence looks like this:
1. Client sends newtmgr command to device.
2. Console passes newtmgr command to shell.
3. Shell allocates the only event and fills it with the data.
4. Shell processes event, hands data to newtmgr code.
5. Newtmgr processes command and sends response.
6. Client sees response and sends follow-up command.
7. Console passes newtmgr command to shell.
8. Shell has no events left; drops incoming command.
9. Initial event gets freed.

By changing the default event count from 1 to 2, we ensure there is always a spare event available. Since we will never send the second response before freeing the first event, two events is sufficient.

The problem seems to be caused by an exhaustion of shell events.  By
default, the shell only allocates a single event.

The sequence looks like this:
    1. Client sends newtmgr command to device.
    2. Console passes newtmgr command to shell.
    3. Shell allocates the only event and fills it with the data.
    4. Shell processes event, hands data to newtmgr code.
    5. Newtmgr processes command and sends response.
    6. Client sees response and sends follow-up command.
    7. Console passes newtmgr command to shell.
    8. Shell has no events left; drops incoming command.
    9. Initial event gets freed.

By changing the default event count from 1 to 2, we ensure there is
always a spare event available.  Since we will never send the second
response before freeing the first event, two events is sufficient.
@ccollins476ad ccollins476ad merged commit ee14e32 into apache:master Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants