I looked at the code of lighter and found one thing which can be very problematic. Lighter allows to create (post) statement ignoring status of a session.
It seems to that if the corresponding session is in one of states:
ERROR
DEAD
KILLED
SUCCESS
statement will be never executed ? It means the statement will always stay in waiting state and will never progress.
I am thinking what could help (but maybe not fully) is to simply check state of corresponding session before saving a statement.
If (!session.state.isComplete()){
//save statement
} else{
...
}
I can implement it but i am just wondering what shall be the HTTP status code and body when session.state.isComplete == true?
Returning HTTP 400 ?
BTW there is another application state SHUTTING_DOWN but seems it is not used anywhere except for test so can be removed.
I looked at the code of lighter and found one thing which can be very problematic. Lighter allows to create (post) statement ignoring status of a session. It seems to that if the corresponding session is in one of states:
statement will be never executed ? It means the statement will always stay in
waiting
state and will never progress. I am thinking what could help (but maybe not fully) is to simply check state of corresponding session before saving a statement.I can implement it but i am just wondering what shall be the HTTP status code and body when
session.state.isComplete == true
? Returning HTTP 400 ?BTW there is another application state SHUTTING_DOWN but seems it is not used anywhere except for test so can be removed.