-
Notifications
You must be signed in to change notification settings - Fork 9
Description
@balhoff This came up in discussion about what might be going on, and I wanted to talk with you about a possible solution to one category of issues. As you're away, I'm just making some notes here that we can talk about when you're back.
Essentially, I believe that minerva takes operations as they are mediated through the web server on a first-come-first-served basis. On slow connections, multiple windows, or when errors occur in a series of commands, this opens up the possibility for data and operations to get garbled.
I think it might be possible to fix this with minimal effort:
- all requests come in as normal
- instead of being operated on, they are put into a FIFO "event queue"
- when a worker takes something from the queue, it looks at the model being operated on and checks is against the hold list
- if the model is not on the hold list, add it and operate
- if model is on the hold list, don't take that request and go to the next one in the queue that does have a hold list model
- if there is an error, respond and remove all requests in the queue to that model, sending errors
- if there is no error, send a response and remove model id from hold list
(locks when necessary)
This essentially would build a "transaction" system at the model/request level, while still allowing operations to continue as usual. The number of workers could still be tied to/identical to the http threads, just with that gating logic before execution.
We believe that this may alleviate a lot of the client issues.
I think that this should be "easy", but please let me know.
Tagging @vanaukenk @pgaudet