-
Notifications
You must be signed in to change notification settings - Fork 633
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
Light-4J (2.0.20) - wrong IPs is used in the LightCluster.discovery() method #2375
Comments
There are several cases the IP might be changed and I am not sure which one is your case and what is your environment. In all cases, we need to restart the target service so that the newly updated IP will be registered to the Consul or light-portal. May I ask why the IP is changed on the target server and the server still running? Thanks. |
We'll add more information once it becomes available, meanwhile, we have asked the person who open this issue to upgrade to the latest light-4j 2.1.37. |
@stevehu , here is more updates from our client : The version 2.1.27 has the same bug reported (#2359 (2.1.21 to 2.1.37) possible bugs on LightCluster & AbstractRegistry classes).
I haven't had the time to relook since i don't have the source code for javax.net.ssl.SSLContextSpi but it failed there. |
From the stack trace, it looks like the problem is in one of your handlers. The class name is "com.#######.cp.router.handler.DataPostHandler". Please check the code in this handler to see if it opens a connection to another service with HTTPS? If yes, please double-check the certificates. Thanks. |
@stevehu : Thank You! I'll forward your comment. |
From our client: The consul URI managed to be extracted (black arrow in the screen shot) In the run() method, this seems to always populate just the service name once the run() kicks off.
if (serviceUrls != null && !serviceUrls.isEmpty()) { boolean change = true; |
Hi Steve .. In a nutshell the service discovery for Light-4J version 2.1.38-SNAPSHOT is not working when there's a tag passed in to serviceToUrl method. Tx |
Are you migrating from the 1.6.x? Is your app working with 1.6.x? If yes, I will try to port the logic from 1.6.x to 2.1.x. Thanks. |
Here’s a summary of the issue as per chronological order.
1, When Light-4J starts, the serviceMap container has the target IP (e.g. 10.10.10.10)
When target changes IP (e.g. 11.11.11.11) , this method will first look at the cache (serviceMap) and if there exists use that.
Issue is the serviceMap contains old IP (10.10.10.10)
Hence wrong IP being used and hence it blows up since IP 10.10.10.10 no longer exists
Here’s the code:
private List discovery(String protocol, String serviceId, String tag) {
if(logger.isDebugEnabled()) logger.debug("protocol = " + protocol + " serviceId = " + serviceId);
// lookup in serviceMap first, if not there, then subscribe and discover.
List urls = serviceMap.get(serviceId);
if(logger.isDebugEnabled()) logger.debug("cached serviceId " + serviceId + " urls = " + urls);
if((urls == null) || (urls.isEmpty())) {
URL subscribeUrl = URLImpl.valueOf(protocol + "://localhost/" + serviceId);
if(tag != null) {
subscribeUrl.addParameter(Constants.TAG_ENVIRONMENT, tag);
The text was updated successfully, but these errors were encountered: