Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix intermittent abort running Ekam in continuous #50

Closed
wants to merge 1 commit into from

Conversation

vlovich
Copy link
Contributor

@vlovich vlovich commented Aug 3, 2021

ekam debug: ERROR: /ekam-provider/canonical/ekam/Driver.cpp:597: Tried to remove source file that wasn't ever added: edgeworker/tests/alarm.ew-test-bin.c++
terminate called after throwing an instance of 'ekam::OsError'
  what():  inotify_rm_watch(inotify): Invalid argument
make: *** [Makefile:360: continuous] Aborted (core dumped)

```
ekam debug: ERROR: /ekam-provider/canonical/ekam/Driver.cpp:597: Tried to remove source file that wasn't ever added: edgeworker/tests/alarm.ew-test-bin.c++
terminate called after throwing an instance of 'ekam::OsError'
  what():  inotify_rm_watch(inotify): Invalid argument
make: *** [Makefile:360: continuous] Aborted (core dumped)
```
@vlovich
Copy link
Contributor Author

vlovich commented Aug 3, 2021

Fixes #1

@kentonv
Copy link
Member

kentonv commented Aug 3, 2021

This looks like it's turning a crash into an error log, but not actually fixing the state inconsistency that led to it? I wonder if it's a good idea to keep using a state that seems to have an inconsistency? Also if we're calling inotify_rm_watch() on an invalid watch descriptor, isn't there a risk that sometimes we call it on a valid descriptor that's the wrong descriptor, and accidentally stop watching a file?

@vlovich
Copy link
Contributor Author

vlovich commented Aug 4, 2021

Open to suggestions. I was hoping logging the fd and wd would prove informative. Maybe just log them for now and propagate the failure?

@kentonv
Copy link
Member

kentonv commented Aug 4, 2021

I don't think the fd is the problem. The first message, from Driver.cpp, indicates a higher level state inconsistency. The subsequent failure manipulating inotify is just a side-effect I think. Possibly a use-after-free even.

@vlovich vlovich closed this Aug 19, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants