Skip to content

Conversation

@mwinter69
Copy link

@mwinter69 mwinter69 commented Apr 13, 2020

To be able to log globally for pipeline a TaskListenerDecorator must be
implemented.
Potentially the decorator will be transferred to the agent jvm so
everything must be Serializable (this is not tested).
This also includes getting information about stage/agent if the logstash step is inside a stage/node

To be able to log globally for pipeline a TaskListenerDecorator must be
implemented.
Portentially the decorator will be transferred to the agent jvm so
everything must be Serializable (this is not tested).
name of stage and/or name of agent are included in the output if the
logstash step is inside a stage and/or agent
public abstract class AbstractLogstashIndexerDao implements LogstashIndexerDao {
public abstract class AbstractLogstashIndexerDao implements LogstashIndexerDao, Serializable {

private static final long serialVersionUID = 1L;

Choose a reason for hiding this comment

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

same thing about serials

*/
public class BuildData {
public class BuildData implements Serializable {
private static final long serialVersionUID = 1L;

Choose a reason for hiding this comment

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

same thing about serials

public class LogstashWriter {
public class LogstashWriter implements Serializable {

private static final long serialVersionUID = 1L;

Choose a reason for hiding this comment

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

same thing about serials

private final static Logger LOGGER = Logger.getLogger(MethodHandles.lookup().lookupClass().getCanonicalName());
public static class TestData {
public static class TestData implements Serializable {
private static final long serialVersionUID = 1L;

Choose a reason for hiding this comment

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

same thing about serials

public class ElasticSearchDao extends AbstractLogstashIndexerDao {

private final HttpClientBuilder clientBuilder;
private static final long serialVersionUID = 1L;

Choose a reason for hiding this comment

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

same thing about serials

@jakub-bochenski
Copy link

This also includes getting information about stage/agent if the logstash step is inside a stage/node

Would this cover the functionality from #92?

@tgatinea

remove field and suppress the warning
the class definition is transferred along side the object thus the
servialversionuid should be the same in any case
@jakub-bochenski
Copy link

@mwinter69 big thanks for another great contribution :)

@jakub-bochenski jakub-bochenski merged commit 322d92f into jenkinsci:master Apr 17, 2020
@gozer2222
Copy link

Hi @jakub-bochenski,

The pipeline is KO, could you take a look, please ?
https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Flogstash-plugin/detail/master/65/pipeline

Thx,

@jakub-bochenski
Copy link

sorry, nothing I can do here, this is Jenkins infrastructure that is not maintaned by me

@gozer2222
Copy link

Hi @jakub-bochenski,

Thank you for your answer.

Sorry if I insist a little bit, I can't wait to test and deploy this new great feature 😉

I'm not an expert, but if you push anything on the master branch that should restart the pipeline and the release process.
So a good option could be to validate the PR #94 (very few changes & relevant), which should then publish the new version and make me and the community happy 🥳

What do you think about that?

@jakub-bochenski
Copy link

Merged, Thanks for bumping it as I missed that PR

@Hokwang
Copy link

Hokwang commented Jul 8, 2020

@jakub-bochenski When will you release this PR? I am waiting.

@jakub-bochenski
Copy link

You can always find the unreleased build in the incremental update center, e.g. current one is https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/logstash/2.4.0-rc195.4527bc400e15/

@Hokwang
Copy link

Hokwang commented Jul 13, 2020

@jakub-bochenski Yeah, I know that user can use unofficial release, but I just wonder when you release new version.

@jakub-bochenski
Copy link

Incremental releases are not "unofficial", they are incremental

Logstash plugin 2.4.0 has been released

@admoriarty
Copy link

@jakub-bochenski Not sure this is worth logging as a Bug yet, so thought to ask here. Our Jenkins masters and plugins are latest but our jnlp slave image is old so it may be on our side, working through upgrades there now. Anyway, since we picked up 2.4.0 last week we've had some odd symptoms such as console logs for stages looping indefinitely in the master, and then spotted this stack in the slave image logs;

WARNING: null
java.lang.IllegalStateException: Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong.
	at jenkins.model.Jenkins.get(Jenkins.java:777)
	at jenkins.model.GlobalConfiguration.all(GlobalConfiguration.java:75)
	at jenkins.plugins.logstash.LogstashConfiguration.getInstance(LogstashConfiguration.java:289)
	at jenkins.plugins.logstash.LogstashWriter.getIndexerDao(LogstashWriter.java:162)
	at jenkins.plugins.logstash.LogstashWriter.getDaoOrNull(LogstashWriter.java:201)
	at jenkins.plugins.logstash.LogstashWriter.<init>(LogstashWriter.java:82)
	at jenkins.plugins.logstash.pipeline.GlobalDecorator.decorate(GlobalDecorator.java:41)
	at org.jenkinsci.plugins.workflow.log.TaskListenerDecorator$DecoratedTaskListener.getLogger(TaskListenerDecorator.java:237)
	at org.jenkinsci.plugins.workflow.log.TaskListenerDecorator$CloseableTaskListener.getLogger(TaskListenerDecorator.java:279)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:740)
	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:161)
	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:154)
	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
	at java.lang.Thread.run(Thread.java:748)

If we turn off "Enable Globally" all is well again (except no logstash output of course :D )

@jakub-bochenski
Copy link

jakub-bochenski commented Aug 6, 2020

@admoriarty please file this as a separate issue
If it's causing problems for you it's an issue alright. Filling it separately should increase visibility in case other people have the same problem.

On the problem itself I don't think that JNLP version is relevant.
If this code executes on the slave then Jenkins instance won't be available period.

@admoriarty
Copy link

admoriarty commented Aug 6, 2020 via email

@admoriarty
Copy link

Eventually raised https://issues.jenkins-ci.org/browse/JENKINS-63472 @jakub-bochenski , felt "critical" made sense since we've basically had to disable the plugin as a result to continue building.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants