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

Implement detection of redundant launcher execution #89

Conversation

DivineThreepwood
Copy link
Member

@DivineThreepwood DivineThreepwood commented Jan 8, 2023

📜 Description

  • Switch to latest openbase type version v1.4
  • Implement detection of redundant launcher execution.
  • Implement LauncherRemote.
  • Setup launcher as controller again and start controller service.
  • Make sure launcher does not initialize if already started.
  • Move MqttIntegrationTest base class into a dedecated test package
  • Implement tests.
  • apply api changes of AbstractLauncher as requested in the pr by renaming isBooting to isLauching and interruptBoot to interruptLaunch.
  • Improve launcher exception handling.
  • Make sure CloseableReadLockWrapper and CloseableWriteLockWrapper are always following an interruptible locking strategy.

Note

  • Sorry for reformatting the entire AbstractLauncher class. Idea did this in background and I detected the changes to late to fully revert them.

…edundant launcher execution. Implement LauncherRemote. Setup launcher as controller again and start controller service.
Copy link
Contributor

@pLeminoq pLeminoq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR looks good overall, but it definitely needs a unit test and/or testing in a live system. With this PR, simply launching bco-test fails on my machine while it works on the dev branch.

DivineThreepwood and others added 3 commits January 9, 2023 20:40
…ing isBooting to isLauching and interruptBoot to interruptLaunch.
@DivineThreepwood
Copy link
Member Author

I have no issues running bco with this jul branch, is this a org.openbase.type issue? It has actually been released.
Do you have any further details here?

@pLeminoq
Copy link
Contributor

pLeminoq commented Jan 9, 2023

I have no issues running bco with this jul branch, is this a org.openbase.type issue? It has actually been released. Do you have any further details here?

I just re-checked and it somewhat works. The startup behavior changed for me, with many warnings being displayed on startup:

21:03:16.363 [pool-2-thread-7] WARN  o.o.j.s.WatchDog ═╦═⚀ Could not start Service[RPCServer[/launcher/bco/templateregistry/ctrl]] try again in 60 seconds...                                                      
21:03:16.363 [pool-2-thread-9] WARN  o.o.j.s.WatchDog ═╦═⚀ Could not start Service[RPCServer[/launcher/bco/messageregistry/ctrl]] try again in 60 seconds...                                                       
21:03:16.363 [pool-2-thread-6] WARN  o.o.j.s.WatchDog ═╦═⚀ Could not start Service[RPCServer[/launcher/bco/unitregistry/ctrl]] try again in 60 seconds...                                                          
21:03:16.363 [pool-2-thread-10] WARN  o.o.j.s.WatchDog ═╦═⚀ Could not start Service[RPCServer[/launcher/bco/authenticator/ctrl]] try again in 60 seconds...                                                        
21:03:16.363 [pool-2-thread-5] WARN  o.o.j.s.WatchDog ═╦═⚀ Could not start Service[RPCServer[/launcher/bco/activityregistry/ctrl]] try again in 60 seconds...                                                      
21:03:16.363 [pool-2-thread-1] WARN  o.o.j.s.WatchDog ═╦═⚀ Could not start Service[RPCServer[/launcher/bco/classregistry/ctrl]] try again in 60 seconds...                                                         
21:03:16.364 [pool-2-thread-7] WARN  o.o.j.s.WatchDog  ╚══╦═⚀ Could not activate Subscriber                                                                                                                        
21:03:16.364 [pool-2-thread-9] WARN  o.o.j.s.WatchDog  ╚══╦═⚀ Could not activate Subscriber                                                                                                                        
21:03:16.364 [pool-2-thread-5] WARN  o.o.j.s.WatchDog  ╚══╦═⚀ Could not activate Subscriber                                                                                                                        
21:03:16.364 [pool-2-thread-10] WARN  o.o.j.s.WatchDog  ╚══╦═⚀ Could not activate Subscriber                                                                                                                       
21:03:16.364 [pool-2-thread-1] WARN  o.o.j.s.WatchDog  ╚══╦═⚀ Could not activate Subscriber                                                                                                                        
21:03:16.364 [pool-2-thread-6] WARN  o.o.j.s.WatchDog  ╚══╦═⚀ Could not activate Subscriber                                                                                                                        
21:03:16.365 [pool-2-thread-9] WARN  o.o.j.s.WatchDog     ╚════⚀ TimeoutException                                                                                                                                  
21:03:16.365 [pool-2-thread-7] WARN  o.o.j.s.WatchDog     ╚════⚀ TimeoutException                                                                                                                                  
21:03:16.365 [pool-2-thread-5] WARN  o.o.j.s.WatchDog     ╚════⚀ TimeoutException                                                                                                                                  
21:03:16.365 [pool-2-thread-10] WARN  o.o.j.s.WatchDog     ╚════⚀ TimeoutException                                                                                                                                 
21:03:16.365 [pool-2-thread-6] WARN  o.o.j.s.WatchDog     ╚════⚀ TimeoutException                                                                                                                                  
21:03:16.365 [pool-2-thread-1] WARN  o.o.j.s.WatchDog     ╚════⚀ TimeoutException                                                                                                                                  
21:03:16.365 [pool-2-thread-9] WARN  o.o.j.s.WatchDog ===================================== 

Still it will launch and launching a second bco-test instance will throw the desired error. However, it will not shutdown properly. Furthermore, if I start bco-registry while bco-test is still running, it does not detect that another instance is already there.

@DivineThreepwood
Copy link
Member Author

I do not have the same startup / shutdown issues, however I could reproduce a deadlock within the shutdown routine that I will address next.

…. Make sure CloseableReadLockWrapper and CloseableWriteLockWrapper are always following an interruptible locking strategy.
@DivineThreepwood
Copy link
Member Author

Deadlock has been fixed.

@DivineThreepwood
Copy link
Member Author

DivineThreepwood commented Jan 11, 2023

I just re-checked and it somewhat works. The startup behavior changed for me, with many warnings being displayed on startup:

Your show output is not related to this PR since none of the new shutdown messages are included. It seems like bco still builds again the dev version of jul and the two bco instances just interfere with each other that then causes the timeouts. Please make sure again, that you are on the right jul branch 88-avoid-redundant-launcher-execution-by-detecting-already-running-launchers-on-network with the latest hash ed92f9ff and performed a new installation via the install.sh script. Than please make sure that the bco binaries referred by your PATH variable actually link to the newly build ones. If this did not help we might have a deployment / local build issue that needs further investigation (e.g: gradle cache issues / unresolvable org.openbase.type dependency that forces gradle to stick to the old jul version).

@DivineThreepwood DivineThreepwood merged commit f905d25 into dev Jan 19, 2023
@DivineThreepwood DivineThreepwood deleted the 88-avoid-redundant-launcher-execution-by-detecting-already-running-launchers-on-network branch January 19, 2023 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid redundant launcher execution by detecting already running launchers on network.
2 participants