Skip to content
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

ZMQ freezes when receiving data #12

Open
JKRT opened this issue Jun 12, 2019 · 7 comments
Open

ZMQ freezes when receiving data #12

JKRT opened this issue Jun 12, 2019 · 7 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Comments

@JKRT
Copy link
Member

JKRT commented Jun 12, 2019

Send and recv is currently handled by

function sendExpression(omc, expr)
   ZMQ.send(omc.socket, expr)
   message=ZMQ.recv(omc.socket)
   return Parser.parseOM(unsafe_string(message))
end

The issue here is that I have managed to freeze it a couple of times (The reason being is that we have ZMQ communication but we do not have any timeout or polling to make the decision to throw a communication error and terminate).

This permanently blocks OMJulia and you need to quit the application. It is possible to use polling or timeout techniques to prevent this behavior. If someone else thinks that could be a good addition I could implement it :)

@JKRT JKRT added bug Something isn't working enhancement New feature or request question Further information is requested labels Jun 12, 2019
@arun3688
Copy link
Contributor

@JKRT adding a timeout is a good option , OMPython also uses timeout mechanism to connect with omc, but not in the sendExpression(), i did not face any such freeze situation in OMJulia, but we can add a timeout parameter in the sendExpression() method, but hopefully timeout value should not be very short

@JKRT
Copy link
Member Author

JKRT commented Jun 12, 2019

@arun3688 I noticed it when I tried some things (I am one of those people who do weird things). Basically, I put a lot of print statements for debugging in the Compiler and that broke OMJulia.. See if I can replicate the issue. However, as you said from just reading the code one can imagine the issue even if it is rare..

Do you know anything about usage patterns for OMJulia? I guess certain things can indeed take a very long time hmm.. Some kind of polling option would be the best I guess?

@JKRT
Copy link
Member Author

JKRT commented Aug 19, 2019

I currently do not have the time to do work on this. It is not really critical but I leave it open should either of us have the time

@arun3688
Copy link
Contributor

@JKRT , I will start looking into it once i finished with OMMatlab Linearization API

@JKRT
Copy link
Member Author

JKRT commented Aug 19, 2019

It is not really a big issue. Just do it if there is nothing else to do. As we discussed we should look into the same thing for OMPython as well, and maybe even OMMatlab since the same issue might occur there

@arun3688
Copy link
Contributor

sure

@JKRT JKRT removed the question Further information is requested label Aug 19, 2019
@JKRT JKRT added the help wanted Extra attention is needed label Aug 27, 2019
@JKRT
Copy link
Member Author

JKRT commented Sep 13, 2019

Seems alright. My only comment is that we maybe should do import ZMQ instead of using ZMQ so we can see which parts that belongs to different modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants