-
Notifications
You must be signed in to change notification settings - Fork 4
pact-avro-plugin fails to startup when pact-plugin-driver uses threads, rather than tokio tasks due to LogBack config #42
Description
See pact-foundation/pact-plugins#68 for background.
When the pact-plugin-driver uses System threads for managing plugins, the Logback config in the pact-avro-plugin is causing issues.
This is rather than using tokio tasks (using threads was introduced for windows due to hanging plugin tests) and I would like to introduce for macos/linux (due to segfaulting plugin tests in pact-go)
I have tried to narrow it down.
The println for the servers port & serverKey is here
The logback config is here
Removing these bits from the config ( the RollingFileAppender & AsyncAppender ) allow the pact plugin statup message to be picked up
pact-avro-plugin/modules/plugin/src/main/resources/logback.xml
Lines 9 to 29 in 6a7a896
<appender name="PLAIN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>logs/plugin.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- daily rollover --> <fileNamePattern>logs/plugin.%d{yyyy-MM-dd}.%i.log</fileNamePattern> <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> <!-- or whenever the file size reaches 50MB --> <maxFileSize>50MB</maxFileSize> </timeBasedFileNamingAndTriggeringPolicy> <!-- keep 30 days' worth of history --> <maxHistory>30</maxHistory> </rollingPolicy> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%line - %message%n%xException{10}</pattern> </encoder> </appender> <appender name="PLAIN_ASYNCFILE" class="ch.qos.logback.classic.AsyncAppender"> <appender-ref ref="PLAIN_FILE"/> <includeCallerData>true</includeCallerData> </appender> <appender-ref ref="PLAIN_ASYNCFILE" />
Effectively this YOU54F#2
I've tried removing just the AsyncAppender to no avail, so this means that to get the avro plugin to work on Windows, we need to disable the logging to file, and if we want to fix pact-go plugin behaviour on macos/linux, we will need to switch over to using threads, which means this issue will affect all users.
cc @uglyog - maybe you can shed some light on the world of java loggers