-
Notifications
You must be signed in to change notification settings - Fork 126
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
ocpp16.ChargePointConnectionHandler unreliable or racy #292
Comments
The disconnect handler is invoked in one of the following cases:
In all these cases no new connection will be accepted, until the old one was properly cleaned up. It is theoretically possible that your scheduler takes away CPU during execution in Do you have logs enabled in the websocket layer? I would expect to see this printed |
@lorenzodonini I think that is exactly what happened that what is theoretically possible happened, it would have been a bit cpu constrained while all this was going on at 3am. Is there a way to enable the websocket layer logs for ocpp go library from inside evcc? |
Thats an evcc topic, not a library topic. |
I don‘t see how this should happen if ocpp-go serialises that? |
I was referring to the callback. The operation order is:
Any new connection is accepted on a dedicarted goroutine (that's how the http mux works), which at that point may run concurrently to your callback.
Yes, I suggest: websocket.SetLogger(yourLogger) // Possibly with debug enabled (it will be spammy though) See if this happens again and post the full logs here. If there really is a bug I didn't see yet, logs should make it more obvious. |
Unless the callback is run in a go routine I don't see either how that should happen. It's still a bit problematic if we could have racy client-side callback code that cannot clearly be serialised. An alternative might be an "online status" api for the CS? |
OCPP version:
[x] 1.6
[ ] 2.0.1
I'm submitting a ...
[x] bug report
[ ] feature request
Current behavior:
In evcc-io/evcc#15890 we're seeing that
ocpp16.ChargePointConnectionHandler
does not seem to always get triggered when a charge point reconnects.Expected behavior:
Connect handler is always triggered after disconnect if a charge point re-establishes connection.
Instead, the order of disconnect and connect events seems arbitrary. Especially, there is no connect event after the last disconnect although the charge point is clearly still connected.
Notice that the connected/disconnected events are not paired in the log. If I should guess, it feels as if inflight sent messages might still trigger a disconnect even after the charge point has already reconnected?
Steps to reproduce:
n/a
Related code:
The handler definition is quite straight forward:
Other information:
Notice that after
2024/09/04 03:14:26
change point is still sending and we can send, but there is noconnect
handler triggered:The text was updated successfully, but these errors were encountered: