-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add a maximum wait time between iterations in the opcua server #295
base: develop
Are you sure you want to change the base?
Conversation
this moves the wait internally to the The drawback now is that because there's a 200ms timeout in fdselect, the iternal part of the server takes way longer to start. Why? Because the server is protected with a mutex, so every node that needs to be created by forte, will need to wait for this 200ms before accessing the server. The best case scenario is that forte can interrupt the |
This will not help. I think it is a very bad idea to hold a mutex while the server is in fdselect. it should hold the mutex when it leaves fdselect to process the packets. Do we have any chance to do that? |
mmm I don't think we can. I couldn't find anything in the server interface nor in the code handling the incoming data in open62541. One possible solution would be to have the actions being executed asyncrhonously. What we do now, whenever we init/exexute/deinit an action (which are the places we touch the server) we hold the mutex. We could pass this actions into a queue (protected by a mutex) and process these between loops of the server, similarly to what it's done in the ecet.
|
After sleeping it over I found an even bigger problem/question: The 20ms lock would also block all publishers for 200ms or? |
6579728
to
400ea89
Compare
yes, you're right. THe problem is how we are dealing the return value from the So, as it is this PR now, we are calling Actually, maybe we can completely ignore the return value and set a CMAKE waitingTime between iterations |
It should be fine now. I still kept the usage of the return time in case there's a callback sooner than the maximum time (e.g. 5ms) and the minimum to avoid cases where for some reason the server always return 0 creating an issue. I chose 10 ms for no reason |
9d3044f
to
2db52b6
Compare
While this is better then before it is still far from ideal. The best would still be that we could invoke a select loop, and only have the lock when the OPC UA server is really processing. But I guess this is not possible with the current API of Open62541 am I right. |
I think that's what we have now. The
Regarding the timeout in fdselect, the API now does not offer the possibility to set the timeout of As we have now we have basically a zero delay for internal calls (publishing data wakes up the waiting semaphore) and |
No description provided.