On Fri, Mar 30, 2018 at 11:15 AM, Baptiste Mathus <
m...@batmat.net> wrote:
> SocketHandler is unusable for real life IMO: any loss of connection will not be reconnected.
> So we need to develop something that *will* reconnect and be more robust for our usage.
You seem to be assuming that you must stream logs to the
`evergreen-client` using a local TCP socket, which is not obvious to
me. There are other options, such as a text file or set of files in
the `var` directory, which would have different robustness
characteristics.
> means we add that component in the core, or at least in some jar added
> to its classpath or something (?). Less common usage pattern than a plugin,
> could it lead to issues?
I think what you are looking for is `jenkins-module` packaging: akin
to a plugin, but bundled in `jenkins.war!/WEB-INF/lib/*.jar` so that
its classes are available in the same loader as `jenkins-core.jar`. If
you are patching `jenkinsci/jenkins/war/pom.xml` for this anyway, this
is trivial (just add it to the list of modules); otherwise, there is a
mojo in `maven-hpi-plugin` to create a customized Jenkins WAR file
based on a stock `org.jenkins-ci.main:jenkins-war` release with some
additions and modifications, which would be appropriate for a
distribution like Essentials / Evergreen anyway.
> we need to use a bit more convoluted way to get
> the early logs from the startup reading Jenkins.logRecords before being able
> to setup our own JUL Handler
This is pretty trivial, no? You register your handler, and at that
moment you also copy everything in `Jenkins.logRecords`—done.
Obviously if there were more than ~256 messages prior to this plugin’s
initialization, you will miss some of the earlier ones, but in such a
case it should be obvious that something is very wrong.
> we'll miss a few very early startup logs which are, IIUC, sent before the
> core sets up the RingBufferLogHandler to populate Jenkins.logRecords.
Sure, but if there were any `WARNING`+ messages printed before that
point very early in Jenkins startup, it likely that the instance is
more or less hosed and you will notice this from a standard HTTP
status check anyway.