
* Print more details about fd leaks * temporarily prevent the leaks from failing the tests Co-authored-by: Oran Agra <oran@redislabs.com>
22 lines
601 B
Bash
Executable File
22 lines
601 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
OS=`uname -s`
|
|
if [ ${OS} != "Linux" ]
|
|
then
|
|
exit 0
|
|
fi
|
|
|
|
# fd 3 is meant to catch the actual access to /proc/pid/fd,
|
|
# in case there's an fd leak by the sentinel,
|
|
# it can take 3, but then the access to /proc will take another fd, and we'll catch that.
|
|
leaked_fd_count=`ls /proc/self/fd | grep -vE '^[0|1|2|3]$' | wc -l`
|
|
if [ $leaked_fd_count -gt 0 ]
|
|
then
|
|
sentinel_fd_leaks_file="../sentinel_fd_leaks"
|
|
if [ ! -f $sentinel_fd_leaks_file ]
|
|
then
|
|
ls -l /proc/self/fd | cat >> $sentinel_fd_leaks_file
|
|
lsof -p $$ | cat >> $sentinel_fd_leaks_file
|
|
fi
|
|
fi
|