I am running into an issue with Jenkins where SCM polling breaks if it gets interrupted before the sync. I believe it has to do with having a null sync id for the previous build so it has nothing to compare against. I have done a bunch of research into this and it would appear that a fix should be coming, however, in the meantime I'm interested in writing a pipeline script that can identify when this happens and send a notification to interested parties alerting them to the fact a job has stopped polling.
One consistent thing with the problem is that when this happens the polling log will have something along these lines:
Polling on: {branch}
No previous build found...
Polling: No changes in previous build.
Polling error; no previous change.
The line here that is different is that Polling error; So I figure if I can set up a pipeline job that can look for I can identify it before my job sits there not running for a good portion of the day even if there are changes.
My main question here is, is there a way to access the polling log from within a pipeline script?