Wait for two 'Started Launcher' lines before connecting to managed LL #5751

Merged
Jackenmen merged 1 commit from wait_for_two_started_lavalink_lines into V3/develop 2022-06-05 02:46:17 +02:00
Jackenmen commented 2022-06-05 00:37:09 +02:00 (Migrated from github.com)

Description of the changes

With the new jar (3.4.0_1347), there's been a change to the spring boot configuration in Lavalink which results in it logging the "Started Launcher" message twice before it is actually ready to receive requests. This PR fixes an issue where we considered the internal LL jar to be ready after the first "Started Launcher" message which resulted in failed connect attempts:
VirtualBoxVM_2022-06-04_23-12-02

Have the changes in this PR been tested?

Yes

### Description of the changes With the new jar (3.4.0_1347), there's been a change to the spring boot configuration in Lavalink which results in it logging the "Started Launcher" message twice *before* it is actually ready to receive requests. This PR fixes an issue where we considered the internal LL jar to be ready after the first "Started Launcher" message which resulted in failed connect attempts: ![VirtualBoxVM_2022-06-04_23-12-02](https://user-images.githubusercontent.com/6032823/172027512-c7b8cd35-6c68-4cb4-8e10-08c84ab7b3ef.png) ### Have the changes in this PR been tested? Yes
PredaaA (Migrated from github.com) reviewed 2022-06-05 00:37:09 +02:00
Jackenmen commented 2022-06-05 00:43:31 +02:00 (Migrated from github.com)

This is example output from current latest Lavalink jar where there are two 'Started Launcher' lines before Lavalink is actually ready:

2022-06-04 22:34:08.215  INFO 112510 --- [main] lavalink.server.Launcher                 : Starting Launcher on raspberrypi3 with PID 112510 (/home/ubuntu/.local/share/Red-DiscordBot/data/pi/cogs/Audio/Lavalink.jar started by ubuntu in /home/ubuntu/.local/share/Red-DiscordBot/data/pi/cogs/Audio)
2022-06-04 22:34:08.241  INFO 112510 --- [main] lavalink.server.Launcher                 : No active profile set, falling back to default profiles: default
2022-06-04 22:34:09.276  WARN 112510 --- [background-preinit] o.s.h.c.j.Jackson2ObjectMapperBuilder    : For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath
2022-06-04 22:34:18.515  INFO 112510 --- [main] lavalink.server.Launcher                 : Started Launcher in 14.887 seconds (JVM running for 18.321)
2022-06-04 22:34:18.527  INFO 112510 --- [main] lavalink.server.Launcher                 : You can safely ignore the big red warning about illegal reflection. See https://github.com/freyacodes/Lavalink/issues/295
2022-06-04 22:34:19.042  INFO 112510 --- [main] lavalink.server.Launcher                 : 

       .   _                  _ _       _    __ _ _
      /\\ | | __ ___   ____ _| (_)_ __ | | __\ \ \ \
     ( ( )| |/ _` \ \ / / _` | | | '_ \| |/ / \ \ \ \
      \\/ | | (_| |\ V / (_| | | | | | |   <   ) ) ) )
       '  |_|\__,_| \_/ \__,_|_|_|_| |_|_|\_\ / / / /
    =========================================/_/_/_/

    Version:        608d24ddb2b7b63d5b4aa23151e8dfa924de5392-SNAPSHOT
    Build:          1347
    Build time:     26.05.2022 14:29:26 UTC
    Branch          walkyst-koe-fork
    Commit:         608d24d
    Commit time:    27.04.2022 18:20:57 UTC
    JVM:            11.0.15
    Lavaplayer      1.3.98-devoxin

2022-06-04 22:34:19.107  INFO 112510 --- [main] lavalink.server.Launcher                 : No active profile set, falling back to default profiles: default
2022-06-04 22:34:23.544  WARN 112510 --- [main] io.undertow.websockets.jsr               : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
2022-06-04 22:34:23.761  INFO 112510 --- [main] io.undertow.servlet                      : Initializing Spring embedded WebApplicationContext
2022-06-04 22:34:23.763  INFO 112510 --- [main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 4625 ms
2022-06-04 22:34:24.415  WARN 112510 --- [main] l.server.config.SentryConfiguration      : Turning off sentry
2022-06-04 22:34:27.185  INFO 112510 --- [main] c.s.d.l.tools.GarbageCollectionMonitor   : GC monitoring enabled, reporting results every 2 minutes.
2022-06-04 22:34:28.626  INFO 112510 --- [main] lavalink.server.config.KoeConfiguration  : OS: Linux, Arch: aarch64
2022-06-04 22:34:28.629  WARN 112510 --- [main] lavalink.server.config.KoeConfiguration  : This system and architecture appears to not support native audio sending! GC pauses may cause your bot to stutter during playback.
2022-06-04 22:34:29.561  INFO 112510 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2022-06-04 22:34:30.816  INFO 112510 --- [main] org.xnio                                 : XNIO version 3.3.8.Final
2022-06-04 22:34:30.903  INFO 112510 --- [main] org.xnio.nio                             : XNIO NIO Implementation Version 3.3.8.Final
2022-06-04 22:34:31.256  INFO 112510 --- [main] o.s.b.w.e.u.UndertowServletWebServer     : Undertow started on port(s) 2333 (http) with context path ''
2022-06-04 22:34:31.263  INFO 112510 --- [main] lavalink.server.Launcher                 : Started Launcher in 12.688 seconds (JVM running for 31.069)
2022-06-04 22:34:31.566  INFO 112510 --- [XNIO-1 task-1] io.undertow.servlet                      : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-06-04 22:34:31.569  INFO 112510 --- [XNIO-1 task-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2022-06-04 22:34:31.616  INFO 112510 --- [XNIO-1 task-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 44 ms
2022-06-04 22:34:31.736  INFO 112510 --- [XNIO-1 task-1] l.server.io.HandshakeInterceptorImpl     : Incoming connection from /127.0.0.1:33718
2022-06-04 22:34:32.168  INFO 112510 --- [XNIO-1 task-1] lavalink.server.io.SocketServer          : Connection successfully established from Red-Lavalink/0.9.3
2022-06-04 22:34:32.288  INFO 112510 --- [XNIO-1 I/O-2] lavalink.server.io.SocketServer          : {"op": "configureResuming", "key": "Red-Core-Audio-557695764617494529-pi", "timeout": 60}

For comparison, this is how it worked in older jars (1275 and earlier):

2022-06-04 22:42:31.954  INFO 112633 --- [main] lavalink.server.Launcher                 : 

       .   _                  _ _       _    __ _ _
      /\\ | | __ ___   ____ _| (_)_ __ | | __\ \ \ \
     ( ( )| |/ _` \ \ / / _` | | | '_ \| |/ / \ \ \ \
      \\/ | | (_| |\ V / (_| | | | | | |   <   ) ) ) )
       '  |_|\__,_| \_/ \__,_|_|_|_| |_|_|\_\ / / / /
    =========================================/_/_/_/

	Version:        8e1010aa9f473f567e5926a1e25b2917ca9c7ac4-SNAPSHOT
	Build:          1275
	Build time:     13.12.2021 11:31:08 UTC
	Branch          dev
	Commit:         8e1010a
	Commit time:    13.12.2021 11:27:16 UTC
	JVM:            11.0.15
	Lavaplayer      1.3.96-original

2022-06-04 22:42:32.774  INFO 112633 --- [main] lavalink.server.Launcher                 : Starting Launcher on raspberrypi3 with PID 112633 (/home/ubuntu/.local/share/Red-DiscordBot/data/pi/cogs/Audio/Lavalink_1275.jar started by ubuntu in /home/ubuntu/.local/share/Red-DiscordBot/data/pi/cogs/Audio)
2022-06-04 22:42:32.780  INFO 112633 --- [main] lavalink.server.Launcher                 : No active profile set, falling back to default profiles: default
2022-06-04 22:42:33.784  WARN 112633 --- [background-preinit] o.s.h.c.j.Jackson2ObjectMapperBuilder    : For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath
2022-06-04 22:42:41.738  WARN 112633 --- [main] io.undertow.websockets.jsr               : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
2022-06-04 22:42:41.934  INFO 112633 --- [main] io.undertow.servlet                      : Initializing Spring embedded WebApplicationContext
2022-06-04 22:42:41.936  INFO 112633 --- [main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 8781 ms
2022-06-04 22:42:45.414  WARN 112633 --- [main] l.server.config.SentryConfiguration      : Turning off sentry
2022-06-04 22:42:48.030  INFO 112633 --- [main] c.s.d.l.tools.GarbageCollectionMonitor   : GC monitoring enabled, reporting results every 2 minutes.
2022-06-04 22:42:49.366  INFO 112633 --- [main] lavalink.server.config.KoeConfiguration  : OS: Linux, Arch: aarch64
2022-06-04 22:42:49.369  INFO 112633 --- [main] lavalink.server.config.KoeConfiguration  : Enabling JDA-NAS
2022-06-04 22:42:49.402  INFO 112633 --- [main] c.s.l.c.natives.NativeLibraryLoader      : Native library udpqueue: loading with filter null
2022-06-04 22:42:49.434  INFO 112633 --- [main] c.s.l.c.natives.NativeLibraryLoader      : Native library udpqueue: successfully loaded.
2022-06-04 22:42:51.217  INFO 112633 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2022-06-04 22:42:53.580  INFO 112633 --- [main] org.xnio                                 : XNIO version 3.3.8.Final
2022-06-04 22:42:53.653  INFO 112633 --- [main] org.xnio.nio                             : XNIO NIO Implementation Version 3.3.8.Final
2022-06-04 22:42:54.355  INFO 112633 --- [main] o.s.b.w.e.u.UndertowServletWebServer     : Undertow started on port(s) 2333 (http) with context path ''
2022-06-04 22:42:54.388  INFO 112633 --- [main] lavalink.server.Launcher                 : Started Launcher in 26.813 seconds (JVM running for 30.652)
2022-06-04 22:42:54.411  INFO 112633 --- [main] lavalink.server.Launcher                 : You can safely ignore the big red warning about illegal reflection. See https://github.com/freyacodes/Lavalink/issues/295
This is example output from current latest Lavalink jar where there are two 'Started Launcher' lines before Lavalink is actually ready: ``` 2022-06-04 22:34:08.215 INFO 112510 --- [main] lavalink.server.Launcher : Starting Launcher on raspberrypi3 with PID 112510 (/home/ubuntu/.local/share/Red-DiscordBot/data/pi/cogs/Audio/Lavalink.jar started by ubuntu in /home/ubuntu/.local/share/Red-DiscordBot/data/pi/cogs/Audio) 2022-06-04 22:34:08.241 INFO 112510 --- [main] lavalink.server.Launcher : No active profile set, falling back to default profiles: default 2022-06-04 22:34:09.276 WARN 112510 --- [background-preinit] o.s.h.c.j.Jackson2ObjectMapperBuilder : For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath 2022-06-04 22:34:18.515 INFO 112510 --- [main] lavalink.server.Launcher : Started Launcher in 14.887 seconds (JVM running for 18.321) 2022-06-04 22:34:18.527 INFO 112510 --- [main] lavalink.server.Launcher : You can safely ignore the big red warning about illegal reflection. See https://github.com/freyacodes/Lavalink/issues/295 2022-06-04 22:34:19.042 INFO 112510 --- [main] lavalink.server.Launcher :  .  _ _ _ _ __ _ _  /\\ | | __ ___ ____ _| (_)_ __ | | __\ \ \ \  ( ( )| |/ _` \ \ / / _` | | | '_ \| |/ / \ \ \ \  \\/ | | (_| |\ V / (_| | | | | | | <  ) ) ) )  ' |_|\__,_| \_/ \__,_|_|_|_| |_|_|\_\ / / / /  =========================================/_/_/_/ Version: 608d24ddb2b7b63d5b4aa23151e8dfa924de5392-SNAPSHOT Build: 1347 Build time: 26.05.2022 14:29:26 UTC Branch walkyst-koe-fork Commit: 608d24d Commit time: 27.04.2022 18:20:57 UTC JVM: 11.0.15 Lavaplayer 1.3.98-devoxin 2022-06-04 22:34:19.107 INFO 112510 --- [main] lavalink.server.Launcher : No active profile set, falling back to default profiles: default 2022-06-04 22:34:23.544 WARN 112510 --- [main] io.undertow.websockets.jsr : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used 2022-06-04 22:34:23.761 INFO 112510 --- [main] io.undertow.servlet : Initializing Spring embedded WebApplicationContext 2022-06-04 22:34:23.763 INFO 112510 --- [main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 4625 ms 2022-06-04 22:34:24.415 WARN 112510 --- [main] l.server.config.SentryConfiguration : Turning off sentry 2022-06-04 22:34:27.185 INFO 112510 --- [main] c.s.d.l.tools.GarbageCollectionMonitor : GC monitoring enabled, reporting results every 2 minutes. 2022-06-04 22:34:28.626 INFO 112510 --- [main] lavalink.server.config.KoeConfiguration : OS: Linux, Arch: aarch64 2022-06-04 22:34:28.629 WARN 112510 --- [main] lavalink.server.config.KoeConfiguration : This system and architecture appears to not support native audio sending! GC pauses may cause your bot to stutter during playback. 2022-06-04 22:34:29.561 INFO 112510 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2022-06-04 22:34:30.816 INFO 112510 --- [main] org.xnio : XNIO version 3.3.8.Final 2022-06-04 22:34:30.903 INFO 112510 --- [main] org.xnio.nio : XNIO NIO Implementation Version 3.3.8.Final 2022-06-04 22:34:31.256 INFO 112510 --- [main] o.s.b.w.e.u.UndertowServletWebServer : Undertow started on port(s) 2333 (http) with context path '' 2022-06-04 22:34:31.263 INFO 112510 --- [main] lavalink.server.Launcher : Started Launcher in 12.688 seconds (JVM running for 31.069) 2022-06-04 22:34:31.566 INFO 112510 --- [XNIO-1 task-1] io.undertow.servlet : Initializing Spring DispatcherServlet 'dispatcherServlet' 2022-06-04 22:34:31.569 INFO 112510 --- [XNIO-1 task-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2022-06-04 22:34:31.616 INFO 112510 --- [XNIO-1 task-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 44 ms 2022-06-04 22:34:31.736 INFO 112510 --- [XNIO-1 task-1] l.server.io.HandshakeInterceptorImpl : Incoming connection from /127.0.0.1:33718 2022-06-04 22:34:32.168 INFO 112510 --- [XNIO-1 task-1] lavalink.server.io.SocketServer : Connection successfully established from Red-Lavalink/0.9.3 2022-06-04 22:34:32.288 INFO 112510 --- [XNIO-1 I/O-2] lavalink.server.io.SocketServer : {"op": "configureResuming", "key": "Red-Core-Audio-557695764617494529-pi", "timeout": 60} ``` For comparison, this is how it worked in older jars (1275 and earlier): ``` 2022-06-04 22:42:31.954 INFO 112633 --- [main] lavalink.server.Launcher :  .  _ _ _ _ __ _ _  /\\ | | __ ___ ____ _| (_)_ __ | | __\ \ \ \  ( ( )| |/ _` \ \ / / _` | | | '_ \| |/ / \ \ \ \  \\/ | | (_| |\ V / (_| | | | | | | <  ) ) ) )  ' |_|\__,_| \_/ \__,_|_|_|_| |_|_|\_\ / / / /  =========================================/_/_/_/ Version: 8e1010aa9f473f567e5926a1e25b2917ca9c7ac4-SNAPSHOT Build: 1275 Build time: 13.12.2021 11:31:08 UTC Branch dev Commit: 8e1010a Commit time: 13.12.2021 11:27:16 UTC JVM: 11.0.15 Lavaplayer 1.3.96-original 2022-06-04 22:42:32.774 INFO 112633 --- [main] lavalink.server.Launcher : Starting Launcher on raspberrypi3 with PID 112633 (/home/ubuntu/.local/share/Red-DiscordBot/data/pi/cogs/Audio/Lavalink_1275.jar started by ubuntu in /home/ubuntu/.local/share/Red-DiscordBot/data/pi/cogs/Audio) 2022-06-04 22:42:32.780 INFO 112633 --- [main] lavalink.server.Launcher : No active profile set, falling back to default profiles: default 2022-06-04 22:42:33.784 WARN 112633 --- [background-preinit] o.s.h.c.j.Jackson2ObjectMapperBuilder : For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath 2022-06-04 22:42:41.738 WARN 112633 --- [main] io.undertow.websockets.jsr : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used 2022-06-04 22:42:41.934 INFO 112633 --- [main] io.undertow.servlet : Initializing Spring embedded WebApplicationContext 2022-06-04 22:42:41.936 INFO 112633 --- [main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 8781 ms 2022-06-04 22:42:45.414 WARN 112633 --- [main] l.server.config.SentryConfiguration : Turning off sentry 2022-06-04 22:42:48.030 INFO 112633 --- [main] c.s.d.l.tools.GarbageCollectionMonitor : GC monitoring enabled, reporting results every 2 minutes. 2022-06-04 22:42:49.366 INFO 112633 --- [main] lavalink.server.config.KoeConfiguration : OS: Linux, Arch: aarch64 2022-06-04 22:42:49.369 INFO 112633 --- [main] lavalink.server.config.KoeConfiguration : Enabling JDA-NAS 2022-06-04 22:42:49.402 INFO 112633 --- [main] c.s.l.c.natives.NativeLibraryLoader : Native library udpqueue: loading with filter null 2022-06-04 22:42:49.434 INFO 112633 --- [main] c.s.l.c.natives.NativeLibraryLoader : Native library udpqueue: successfully loaded. 2022-06-04 22:42:51.217 INFO 112633 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2022-06-04 22:42:53.580 INFO 112633 --- [main] org.xnio : XNIO version 3.3.8.Final 2022-06-04 22:42:53.653 INFO 112633 --- [main] org.xnio.nio : XNIO NIO Implementation Version 3.3.8.Final 2022-06-04 22:42:54.355 INFO 112633 --- [main] o.s.b.w.e.u.UndertowServletWebServer : Undertow started on port(s) 2333 (http) with context path '' 2022-06-04 22:42:54.388 INFO 112633 --- [main] lavalink.server.Launcher : Started Launcher in 26.813 seconds (JVM running for 30.652) 2022-06-04 22:42:54.411 INFO 112633 --- [main] lavalink.server.Launcher : You can safely ignore the big red warning about illegal reflection. See https://github.com/freyacodes/Lavalink/issues/295 ```
aikaterna (Migrated from github.com) approved these changes 2022-06-05 02:43:36 +02:00
red-githubbot[bot] commented 2022-06-05 02:46:24 +02:00 (Migrated from github.com)

Sorry, @jack1142, I could not cleanly backport this to 3.4 due to a conflict. Please backport using cherry_picker on command line.

cherry_picker cf85a6470fb17e1038f7448b9ed623ed83a424b5 3.4
Sorry, @jack1142, I could not cleanly backport this to `3.4` due to a conflict. Please backport using [cherry_picker](https://pypi.org/project/cherry-picker/) on command line. ``` cherry_picker cf85a6470fb17e1038f7448b9ed623ed83a424b5 3.4 ```
red-githubbot[bot] commented 2022-06-05 02:50:03 +02:00 (Migrated from github.com)

#5752 is a backport of this pull request to Red 3.4.

#5752 is a backport of this pull request to [Red 3.4](https://github.com/Cog-Creators/Red-DiscordBot/tree/3.4).
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot!5751
No description provided.