Skip to content

Read timeouts in fsmpico#4

Open
saebischer wants to merge 2 commits intomasterfrom
read-timeouts-in-fsmpico
Open

Read timeouts in fsmpico#4
saebischer wants to merge 2 commits intomasterfrom
read-timeouts-in-fsmpico

Conversation

@saebischer
Copy link
Copy Markdown

Transfer of merge request !90 from GitLab.

This commit is a transfer of GitLab branch 88-read-timeouts-in-fsm.
Copy link
Copy Markdown
Member

@dettonijr dettonijr left a comment

Choose a reason for hiding this comment

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

The changes here will fail when merged with the tests... To fix you can cherry-pick this:
bbe200a

Comment thread src/fsmpico.c
// Defines

#define READ_TIMEOUT (5000)
#define CONTINUOUS_TIMEOUT_LEEWAY (1000)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we unify those two constants in a single leeway? They seem to have similar semantics.

Comment thread src/fsmpico.c Outdated
fsmpico->comms->write(buffer_get_buffer(message), buffer_get_pos(message), fsmpico->user_data);
stateTransition(fsmpico, FSMPICOSTATE_SERVICEREAUTH);
// set a timeout for awaiting a response
fsmpico->comms->setTimeout(fsmpico->reauthDelay + CONTINUOUS_TIMEOUT_LEEWAY, fsmpico->user_data);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is some inconsistence in this timeout.

Service sends reauth 10 seconds
Pico replies back and set a timeout to 10s + LEEWAY
Service sends reauth 10 seconds
Pico waits for 10 seconds
Pico replies back and set a timeout to 10s + LEEWAY

The timeouts should expire in the same point in time.

Remove the timeout between reading a ServiceReauth message and sending the PicoReauth message.
Comment thread src/fsmpico.c
fsmpico->comms->write(buffer_get_buffer(message), buffer_get_pos(message), fsmpico->user_data);
stateTransition(fsmpico, FSMPICOSTATE_STATUS);
// set a timeout for waiting for the status message
fsmpico->comms->setTimeout(READ_TIMEOUT, fsmpico->user_data);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To match the pattern of fsmservice, the timeout on connect is sufficient. This timeout should be removed, unless there's a good reason for it that I'm missing?

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.

3 participants