-
Notifications
You must be signed in to change notification settings - Fork 23
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
Version mismatching issue after major API version update #137
Comments
@egwakim this is a good question, I was wondering about that too. It was theoretically possible to support option similar to (2) but in the cost of keeping both server and client with complexity (server will support both protocols). In our case there is a better control of the Python client so there is no need to support both server modes in the Python client. Option (2) as you wrote it is not an option, the all points of the major version is to break compatibility, a better option is to keep the major version as the old version and to let the server to support both modes but again beacuse of the severity of the issue I didn't want to do it |
@egwakim it is not that complex to support both modes in the client, you can try the get_async_event API, if it is there , run the new code, else keep the old async code. it should not be complex to support it |
Currently "get_async_event" is not really utilized in trex-java-sdk for any function provider, which means it will be no problem to run older client on a new TRex server. my colleague @ningning-chen has already tried a solution to make java client running on both 4.x and 5.0 server. Only one problem exists in ASTF mode, as mentioned at #135, where it says acquire command at ASTF needs new added "session_id" parameter, my experience shows that TRex server will ignore unrecognized parameter when parsing json command, so in previous old server where the invalid "session_id" parameter will be ignored intentionally when receiving acquire request, if it's true, then java client can work correctly for both old and new server in ASTF mode. |
With a new server (that has
Correct, older server ignores the session_id To summarize:
|
@hhaim But on top of trex-java-sdk, we have another private java client library, where the async port is utilized to fetch the port statistics periodically, so I guess we can apply your suggestion to add the adaption for old&new server in this library. |
@leomaatEric if the java-sdk does not use the async port there is no new issue. I don't understand how the user of the sdk known about events (e.g. traffic was stopped) , how did you implement the Your java client lib should not use the port counters for async, it is very old implementation. Only important events should be used by this channel. |
@hhaim in trex-java-sdk it monitors the port state on which if traffic is triggered, wait_for_traffic like method depends on the result from this monitor, so it's a initiative operation by user, no need to pool the event queue. And for the port counter, yes, you are right, we had replaced the functionality by using RPC "get_port_stats" command, but it's a very earlier implementation before new "get_port_stats" was added in trex software, we just keep it for back compatibility and "forget" to remove it then. I think we will delete it very soon. so after all to proceed the major API version uplift we can handle it in a easy way for now that is just adapting both 4.x and 5.0 in trex-java-sdk. |
@leomaatEric understood. |
@hhaim I tested my previous async code, it works well with new TRex server with 5.0 api_version, which makes me confused, because based on our previous discussion I have to use "get_async_event" to fetch async event in new TRex server, the legacy way should not work anymore. For more easy to understand my case, here is the code piece in my java client
|
@leomaatEric with the new server version (5), the object that you will get from async channel is a clear object If your JAVA API design is to read the state of the server (pool) instead of wating for events, I'm not sure you need those events. The design of the Python API is based on async events (reliable) |
Hi @hhaim
After major version update, Java API and TRex should have exactly same version.
It's really picky issue because we have too many Java client users with various versions of TRex server and Java APIs.
Currently, with this major update, the version of all Java client and TRex server should be synchronized at the same time.
It's hard to handle for large scaled distributed users.
We need temporary coexisting period before uplifting peers.
Maybe 2 options would be possible,
Do you have any suggestion regarding this issue?
The text was updated successfully, but these errors were encountered: