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

Endpoint redirection documentation #447

Merged
merged 20 commits into from
Sep 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/specs/sequences/endpoint_reconfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ sequenceDiagram
participant D as Device
participant E as Original Endpoint
participant E' as New Endpoint
E->>D:CONFIG MESSAGE<br>blobset.blobs._iot_endpoint_config.base64 = <ENDPOINT><br>blobset.blobs._iot_endpoint.blob.phase = "final"
D->>E:STATE MESSAGE<BR>blobset.blobs._iot_endpoint_config.blob.phase = "apply"
E->>D:CONFIG MESSAGE<br>blobset.blobs._iot_endpoint_config.base64 = <ENDPOINT><br>blobset.blobs._iot_endpoint.phase = "final"
noursaidi marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

pedantically there should be a check at the start that verifies that state.blobset.blobs._iot_endpoint_config == null (as the config block is empty so there should be no corresponding state).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added

D->>E:STATE MESSAGE<BR>blobset.blobs._iot_endpoint_config.phase = "apply"
D-->>E':CONNECTION ATTEMPT
grafnu marked this conversation as resolved.
Show resolved Hide resolved
E'->>D:CONFIG MESSAGE
D->>E':STATE MESSAGE<BR>blobset.blobs._iot_endpoint_config.blob.phase = "final"
D->>E':STATE MESSAGE<BR>blobset.blobs._iot_endpoint_config.phase = "final"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should add an additional config/state sequence at the end that starts with config.blobset.blobs._iot_endpoint_config = null and then we verify that the state.blobset.blobs._iot_endpoint_config == null The fundamental reason is that we want to verify that the state block only shows up when expected.

Copy link
Collaborator

Choose a reason for hiding this comment

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

there should be a check in here that the system.last_update time of the state message matches the config timestamp from the new endpoint (so might need to indicate that too). Goal is to check that they don't just connect and then use the wrong reply.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How long does phase: final stay in the state message for? Atleast 1? Noting also that the new endpoint probably won't have a blobset.blob._iot_endpoint_config blob

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added last_update and timestamps for config and state messages

```

### Invalid Endpoint (Unsuccessful Reconfiguration)
grafnu marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -39,12 +39,12 @@ sequenceDiagram
participant E as Original Endpoint
participant E' as New Endpoint
E->>D:CONFIG MESSAGE<br>blobset.blobs._iot_endpoint_config.blob = <ENDPOINT><br>blobset.blobs._iot_endpoint.blob.phase = "final"
D->>E:STATE MESSAGE<BR>blobset.blobs._iot_endpoint_config.blob.phase = "apply"
D->>E:STATE MESSAGE<BR>blobset.blobs._iot_endpoint_config.phase = "apply"
D-->>E':CONNECTION ATTEMPT
note over D: Failure, e.g. endpoint doesn't exist, incorrect credentials, ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

what about a time limit here? I'd be worried that somebody implements a "try for 3h before reporting failure" scenario... so we should just have a fixed time-bound (which will be needed for the test anyway)... 30s? We can always increase it later, and devices can always report failure faster.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added note for 30 seconds

D-->>E:CONNECTION ATTEMPT
E->>D:CONFIG MESSAGE
D->>E:STATE MESSAGE<BR>blobset.blobs._iot_endpoint_config.blob.phase = "final"<BR/>blobset.blobs._iot_endpoint_config.blob.status.level=500(ERROR)
D->>E:STATE MESSAGE<BR>blobset.blobs._iot_endpoint_config.phase = "final"<BR/>blobset.blobs._iot_endpoint_config.status.level=500 (ERROR)
Copy link
Collaborator

Choose a reason for hiding this comment

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

somewhere we need to introduce a category(s) for this too...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do we differentiate for different types of failure? Or is it a single endpoint.reconfig.failed or similar?
A pretty common error I've encountered before is an endpoint "unreachable" because of firewall or network restrictions. Would that be its own category, or is that level of detail left to the message?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Category added


```

Expand Down