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

How can an application signal that it will no longer block a context change #341

Open
bvdh opened this issue Nov 9, 2020 · 4 comments
Open

Comments

@bvdh
Copy link
Collaborator

bvdh commented Nov 9, 2020

When an application cannot follow a context change event, it will respond with a sync-error. This will notify the other applications that they are no longer in sync.
When the application has resolved the issue - how does it signal that context can be changed? Does it wait for a resend of the -open/-close event or can it actively signal this?

@isaacvetter
Copy link
Collaborator

There is no way to currently actively signal the ending of a synchronization failure. It's a good idea.

What would you name such an event? I suppose it would be broadcasted to systems that subscribed to it?

@bvdh
Copy link
Collaborator Author

bvdh commented Nov 25, 2020

Some thoughts.

A sync-error means that one or or more applications are not in sync - did not follow the event indicated by the event-id.
Re-establishing sync, means that all applications are in sync again.

Root causes of sync-errors are:
1 application refuses change
2 an error in the application makes it impossible to process the change.
3 network error when sending the event
4 application has closed and did not unsubscribe

The only mechanism in the current specification is that the sender of the original spec, will resend the event after a short time.

Sync can only be re-established when the "network" is sound again - all application can receive events and are present. Topic 3 and 4 will be automatically handled as websockets will be closed and the application needs to resubscribe.

2 should be handled by the hub - if an error occurs regularly, the hub should unsubscribe it. Which will happen anyway after the timeout.

That leaves 1. The application could "withdraw" a syncerror with a syncrestored message. This could be a trigger to the hub to resend the original event (only when it is still the current one).
The advantage of this approach is that no .write authorization is required for the application that sends the syncrestored message. Note that the resending of the Patient-open by original and hub are still valid options also in this situation.

Conclusion:

  • hubs SHALL resend an event that causes a sync-error, unless issue has been resolved by newer events.
  • applications SHOULD resent an event that causes a sync-error
  • applications SHOULD send a syncrestored event when the sync-error cause has been restored. This will trigger the hub to resent the original event (when relevant).

Would this work>

@gkustas
Copy link

gkustas commented Nov 25, 2020

I just left a comment in #311 regarding syncerror. My scenario falls into your second root causes @bvdh - an error in the application (PowerScribe) that made it impossible to process the change. How would your proposal work in this situation?

Like I said in the other thread, the end user sees the original error, and hopefully can rectify the error. In our case, the user will choose the appropriate study (accession from the proper RIS site) from the PowerScribe worklist, re-open the report causing another DiagnosticReport-open, and everyone would be back in sync again.

Or do you see other scenarios where the syncerror is used effectively?

@bvdh
Copy link
Collaborator Author

bvdh commented Nov 26, 2020

Sync-error will also be effective in indicating any of the other scenario's and can be used as a trigger to provide visual feedback to the user that sync is lost.
I think your scenario is good example of where an application due to a reason outside the scope of networking etc. refuses a context-change. I think that my solution will cover this.
Are we in sufficient agreement to move this into the spec (STU3 or STU2?).

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

No branches or pull requests

3 participants