zowe / api-layer

The API Mediation Layer provides a single point of access for mainframe service REST APIs.
Eclipse Public License 2.0
56 stars 63 forks source link

Bug encountered when caching-service infinispan is running with same ports as another Zowe server #3883

Open struga0258 opened 1 week ago

struga0258 commented 1 week ago

Describe the bug While using the new caching-service infinispan I ran into some bugs. The first one is that the Zowe start up doesnt check if the ports for jgroup or keyExchange are already in use. The other bug I encountered is that, I had the same ports for jgroup and keyExchange as another user that was running Zowe and it started using that other uses workspace/caching-service/index and workspace/caching-service/data. I tried to use the presistence.dataLocation parameter but that didn't work. I believe its missing an option to update the cluster name as well, avoiding these unrelated zowe instances to unknowingly join the same cluster.

Steps to Reproduce

  1. Start two Zowe with the same ports under jgroup and keyExchange
  2. You will see the second Zowe start but the caching service will throw errors in the log and doesn't start.

Expected behavior Zowe should fail during startup if ports are taken.

Additional context I also noticed infinspan starting to use random ports and its due to its behavior to chose available ports, I believe we should update this info in the Zowe docs since its missing.

Willingness to help Sure, i can help debug and test this.

https://github.com/zowe/api-layer/wiki/Issue-management

1000TurquoisePogs commented 1 week ago

FYI caching-service already checks if its own server port is free. perhaps the same technique is a solution for infinispan ports? https://github.com/zowe/api-layer/blob/v3.x.x/caching-service-package/src/main/resources/bin/validate.sh#L14