대량의 io가 발생하는 환경에서 read 가 실패할경우 예외처리.
글쓴이: 송파구최고존엄 / 작성시간: 금, 2019/06/14 - 2:00오후
안녕하세요 file i/o에 문제가 생겨서 문의차 글올려봅니다.
현재 리눅스환경에서 fanotify 를 이용하여 파일 정보를 수집중입니다.
평상시에는 괜찮다가 파일 io가 대량으로 수행이 되면 (예, while(1) echo "1123"~~ 반복하는 쉘스크립트 실행)
read가 실패하더군요 그래서 실패할경우 for문으로 10번정도 반복시도 하면서 usleep 10000정도를 주고 재시도를 해봤는데 결국 똑같이 10번 실패를 합니다.
혹시 이러한 경우 예외처리를 어떻게 해야하는지 궁금합니다.
fd를 닫았다가 다시열면 괜찮을까요 ?
Forums:


fanotify 에 대해 잘 모르는데,
fanotify 에 대해 잘 모르는데,
메뉴얼을 보니, http://man7.org/linux/man-pages/man7/fanotify.7.html
에러들이 있습니다. 아마 그에 대해 처리해야 하지 않을까요?
In addition to the usual errors for read(2), the following errors can occur when reading from the fanotify file descriptor: EINVAL The buffer is too small to hold the event. EMFILE The per-process limit on the number of open files has been reached. See the description of RLIMIT_NOFILE in getrlimit(2). ENFILE The system-wide limit on the total number of open files has been reached. See /proc/sys/fs/file-max in proc(5). ETXTBSY This error is returned by read(2) if O_RDWR or O_WRONLY was specified in the event_f_flags argument when calling fanotify_init(2) and an event occurred for a monitored file that is currently being executed. In addition to the usual errors for write(2), the following errors can occur when writing to the fanotify file descriptor: EINVAL Fanotify access permissions are not enabled in the kernel configuration or the value of response in the response structure is not valid. ENOENT The file descriptor fd in the response structure is not valid. This may occur when a response for the permission event has already been written.송최존님 혹시 errno가 뭔지 알 수 있나요?
송최존님 혹시 errno가 뭔지 알 수 있나요?
9 BAd Descp~~ 나옵니다.
9 BAd Descp~~ 나옵니다.
댓글 달기