-
-
Notifications
You must be signed in to change notification settings - Fork 395
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
Transaction returning ConcurrentTX as status not stopped #1478
Comments
this is by design. i addressed this point in various issues, here is one example. |
an excerpt from another msg:
|
The transaction lifecycle should be a state machine hindering duplicate transactions on the same EVSE to stay opened on the CSMS side. A soft stop is a simulation of a stop transaction using the latest transaction metervalues to compute the meterstop. The transaction in soft stop state can be put in stop state if a stop transaction is received later on. The current design at transaction lifecycle handling is too fragile and require needlessly manual housekeeping of the transactions. |
steve already has the functionality of what you call "soft stop", which the user has to do manually in GUI because i didn't enforce this globally. what is your suggestion? to automate this soft stop? this is a workaround with heuristics to make the decision about stop values. this decision might be lossy/wrong: what if some messages (i.e. metervalues) were delayed and therefore the steve is not up-to-date with the latest info, and therefore ends this tx with wrong values? or, what if StopTransaction of the previous tx was delayed, and steve wrongly (i.e. false positive) ended that even though StopTransaction would have arrived later? |
The suggestion was to make the transaction lifecycle a state machine, like in OCPP 2 specs.
Since Java is probably offering state machine libraries, it will probably end up make the code cleaner with conditions at state transition expressed in a central abstraction.
A transaction lifecycle modeled against a state machine is able to deal with all of them:
Once the state machine model capture and implement a transaction lifecyle with all possible states and transition conditions, it becomes more easy to automate actions in a robust way, even as tunables disabled by defaults. To summarize:
|
i think you are focusing too much on a technicality (i.e. state machines) but not much on the business side. state machine is a just a model of real world states, transitions and conditions how to transition from a state to the next. if the conditions are blurry (which is my claim), it does not save us in that regard. my questions were about the business flows (i.e. what workarounds to apply and how) and how to eliminate operational deadlocks. if the charging station is not sending some information (e.g. meter values, stop transaction), steve's workarounds and derived actions will be wrong. and therefore, your arguments in
are not addressing my aforementioned concerns. but hey, this is open source, i would welcome your contribution in a PR and have no problem at the end admitting i am wrong if i am wrong, as long as the final product will be better. |
business model, workflows, ... can all be modeled as state machines with a deterministic behavior:
It's not a claim or an opinion, it's a proven theoretical fact in discrete mathematics. The transaction lifecycle does not have blurry transition conditions set since it's not an infinite set and can modeled by a discrete (hence deterministic) state machine: WS connection states and transitions are finite, connector states and transitions are finite, OCPP messages states are finite, etc. (the whole underlying system is using discrete sets of states and transitions conditions) How complex is the resulting state machine model for transaction lifecycle?
(Already done and implemented in proprietary code) How complex is the code implementing it? less complex than the initial code with ugly hacks in various code path checking for OCPP message status, charging station connector status, WS connection status, connector status and consolidated in a unique place. The reporting on transaction is more clear in dashboard and logs. Overhead? Memory mainly The topic is not about: Can a state machine model transaction lifecycle deterministically? The answer is already known. (just like Can finite automata a model regular expression? Can non deterministic finite automata model a programming langage syntax? ...). The questions are: is there alternative model less costly? does the effort worth it? is the state machine model complete (probably not, human make mistakes at modelling)? can we live without modeling it as state machine (less complex system such as TCP connection states is implemented without formal state machine, but complex one cannot)? ... In the end, I would like to orient the discussion on 'how to make the transaction lifecyle more robust?' State machine usage is one known to work answer (hope my previous explanations make it crystal clear). |
thank you for the lecture on state machines... even though i know them quite well myself and implemented them professionally before. as i said, feel free to contribute to the project. it would be a welcome enhancement. |
Since it's not a simple bug fix, but something needing a design document open to discussion, review: does the project use RFC in its workflow for features? How are usually elaborated features design? |
Checklist
Specifications
Description
Starting several transactions with the same id tag end up having one transactions accepted and other concurrenttx but not stopped server side.
It can lead to a DoS by flagging all tags as used in never stopped transactions.
Steps to Reproduce the Problem
The text was updated successfully, but these errors were encountered: