Recently I undertook the task of refactoring batch processing at work. The jobs followed a similar pattern of records get staged, messages are sent and the stage status is updated for each message. This causes numerous DB connections to be opened up for every message and doing updates in separate threads seemed like a waste of time to me.
This made me think about batch updates and a pattern where a single thread does all the updates when the process finishes. The important point here is knowing when the process has finished. For me that was when no message has been sent for an arbitrary amount of time. Implementing the below interface did the trick for me:
I recently ran into a situation where Jenkins upstream jobs screwed up and my downstream jobs started building every branch in Git. I had to fix the issue and then try to clear up the builds. Thankfully the Jenkins community is aware of these issues and they provided a CLI to play with the jenkins environment:
Access the CLI at:
Then run the below command:
There is a bug with the above where it throws the ‘no job found error'. To fix this we have to give the anonymous user discover and read access for jobs under Jenkins Global security configuration.
Say you committed some code, then committed some experimental stuff on top of that and went back to the original commit and changed some stuff. Totally normal situation. Now you want to submit a merge request, but only for the completely baked code. One solution is to re-order commits and squash the commits you want to merge into your cherry picked commit: