Skip to content

Instantly share code, notes, and snippets.

View vfreex's full-sized avatar

Yuxiang Zhu vfreex

View GitHub Profile
@vfreex
vfreex / README.md
Created December 6, 2016 07:42
What happens when you cancel a Jenkins job

When you cancel a Jenkins job

Unfinished draft; do not use until this notice is removed.

We were seeing some unexpected behavior in the processes that Jenkins launches when the Jenkins user clicks "cancel" on their job. Unexpected behaviors like:

  • apparently stale lockfiles and pidfiles
  • overlapping processes
  • jobs apparently ending without performing cleanup tasks
  • jobs continuing to run after being reported "aborted"
@vfreex
vfreex / list.h
Created November 17, 2016 10:49
simple doubly linked list that is similar to the linux kernel
#ifndef _LT_DOUBLY_LINKED_LIST_H
#define _LT_DOUBLY_LINKED_LIST_H
#ifndef offsetof
#define offsetof(type, member) \
((size_t) &((type*) 0)->member)
#endif
#ifndef container_of
#define container_of(ptr, type, member) \
import signal, sys, threading, time
THREADS = []
def handler(signal, frame):
global THREADS
print "Ctrl-C.... Exiting"
for t in THREADS:
t.alive = False
sys.exit(0)
@vfreex
vfreex / namespaces_netlink_test.c
Created September 5, 2016 10:22
namespaces_netlink_test.c