These are chat archives for spring-cloud/spring-cloud

12th
Dec 2016
Dante Sun
@dantesun
Dec 12 2016 11:26
Is thare a way that skip the application context intializer when spring cloud bootstrap context is initializing? I found that the initializer in spring.factories I installed is invoked twice.
Dave Syer
@dsyer
Dec 12 2016 11:40
You can check in your initializer if you are running in bootstrap
A clear signal is a property source in the Environment called "bootstrap"
org.springframework.cloud.bootstrap.BootstrapApplicationListener.BOOTSTRAP_PROPERTY_SOURCE_NAME
Stefan Pfeiffer
@dl1ely
Dec 12 2016 11:52
Cloud Config Server: I use it in „native“ profile against a directory of .yml files, using the File System Watcher. When i change something in application.yml, the config server sends following RefreshRemoteApplicationEvent:
{"type":"RefreshRemoteApplicationEvent","timestamp":1481543248684,"originService":"infrastructure-configserver:native:8888","destinationService":"D:\\Entwicklung\\Daten\\projects\\config\\local\\application:**","id":"424ec3ce-7b5b-481f-9ed6-5fa3ccb7e12c"}
My services do not react to those events, as the destinationService surely does not match ApplicationContext.getId(), so BusAutoConfiguration.java from Spring Cloud Bus will not propagate the remote event locally.
I wonder no one noticed before, so i think i overlooked something?
Dave Syer
@dsyer
Dec 12 2016 12:00
Looks like a bug to me.
Probably nobody tried it with "native" profile on Windows (or at all)
Stefan Pfeiffer
@dl1ely
Dec 12 2016 12:04
You think it has to do with Windows?
This one seems to fail on guessing the services to address based on the file name changed
Will fix it and provide a PR
Well, its easy...it does not like file path segments in front of the changed file name...application-profile.yml would work, but subdir/application-profile.yml would not.
Dave Syer
@dsyer
Dec 12 2016 12:08
Awesome.
Stefan Pfeiffer
@dl1ely
Dec 12 2016 12:08
Question is: Fix it there in guessServiceName() or somewhere upstream?
Dave Syer
@dsyer
Dec 12 2016 12:08
guessServiceName() seems like the best place
Did you not think so?
Stefan Pfeiffer
@dl1ely
Dec 12 2016 12:09
Well, if it works on Linux, then obviously the filewatcher returns dir-less paths there, while on windows it returns absolute paths?
I have no linux system available for testing
Dave Syer
@dsyer
Dec 12 2016 12:10
the CI server tests on Linux
so if you propose a PR it will run on Linux
Stefan Pfeiffer
@dl1ely
Dec 12 2016 12:10
But if it would return absolute paths there, it would not work either. /home/user/config/application-profile.yml has the same problem
So the question is to normalize paths to only the file name path somewhere upstream from guessServiceName()? Perhaps other methods in the server aren't expecting absolute paths, too?
Dave Syer
@dsyer
Dec 12 2016 12:12
I don't think the notifications would be much use if they didn't contain any path information
Stefan Pfeiffer
@dl1ely
Dec 12 2016 12:16
??? They are only used in destinationService, where they should map to the ${spring.application.name} of the applications to notify
Ah sorry, got your comment wrong
you are right
I will fix it in guessServiceName()
Ah, it tests notifyByForm, not notifyByPath
Stefan Pfeiffer
@dl1ely
Dec 12 2016 14:05
Hm, but that uses notifyByPath again. I see i have to investigate further :-)
Stefan Pfeiffer
@dl1ely
Dec 12 2016 14:19
I cannot run the spring-cloud-config tests :-(
Tests in error:
  findOne_FileAddedToRepo_FindOneSuccess(org.springframework.cloud.config.server.environment.JGitEnvironmentRepositoryIntegrationTests): Could not delete file D:\Entwicklung\Daten\gh\spring-cloud-config\spring-cloud-config-server\.\target\repos\config-repo\.git\objects\pack\pack-d4edd2290fa647beaa1255881228dc90c1d53fce.pack
The file that cannot be deleted is right there, and i can delete it manually without any problem. I even deleted the whole \target\ directory and rerun the tests, still the same
Any ideas?
Dave Syer
@dsyer
Dec 12 2016 14:22
Switch to Linux?
Stefan Pfeiffer
@dl1ely
Dec 12 2016 14:25
If you only want contributions from linux users, why not say so in the README upfront? Would save us windows guys much hassle. I am really disappointed by this answer. But nice to know, thank you very much.
Dave Syer
@dsyer
Dec 12 2016 14:28
I was joking.
But we don't have any windows users in the team so it takes a lot of effort to track down and fix issues like that
Your efforts are very much appreciated
Stefan Pfeiffer
@dl1ely
Dec 12 2016 14:30
I guess the dot in the middle is the problem? I will have a look and make a PR so i can start work on that other PR.
Stefan Pfeiffer
@dl1ely
Dec 12 2016 15:22
I am sorry, i have to give up on that one. That file cannot be deleted because it is locked by another process. I cannot determine which process it is and why. I can only guess there is a prior test that does not close its handles correctly. I am sure it works on Linux, but not on windows.
Dave Syer
@dsyer
Dec 12 2016 15:26
Thanks for trying. Please send a PR for that other thing if you can write a test that passes in isolation (the build will be green that way).
here's already an issue open BTW #531
#293 looks the same as the locked file issue as well
And some changes were already made to fix that and also #315
Stefan Pfeiffer
@dl1ely
Dec 12 2016 15:43
Yes, you are right. I looked at open issues, but somewhat overlooked #531.
Stefan Pfeiffer
@dl1ely
Dec 12 2016 15:53
#293 and #315 are nice, but don't help me identifying the remaining problems. T4gedieb obviously knows how to find those open handles...I never had to deal with this stuff
Stefan Pfeiffer
@dl1ely
Dec 12 2016 16:03
I have pinged him in the issue, perhaps he can help
Stefan Pfeiffer
@dl1ely
Dec 12 2016 16:31
PR for #531 submitted
Dave Syer
@dsyer
Dec 12 2016 16:32
Thanks
Stefan Pfeiffer
@dl1ely
Dec 12 2016 16:47
Is CI running in my PR?
Spencer Gibb
@spencergibb
Dec 12 2016 16:48
should be
Stefan Pfeiffer
@dl1ely
Dec 12 2016 16:48
I only see the CLA checker and codacy?
Dave Syer
@dsyer
Dec 12 2016 17:33
I see travis and circle config files
It's not obvious if travis is running though
The config doesn't look right to me (ping @ryanjbaxter since he changed it recently)