Listed several pitfalls in GitLab that might be troublesome in developers’ daily life:
1. Resource Leak While Cancelling Job
Each GitLab job can have script and after_script blocks. Normally, we prepare resources and do the job execution in the script block and cleanup or recycle the resources in the after_script block.
job:
before_script:
- prepare resouces and requisites
script:
- job commands
after_script:
- cleanup/recycle resources
This works well in most scenarios. However, when we manually cancel the job, the after_script block won’t get executed. Resources allocated in the script block might be hanging around there permanently.