Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

epoll: introduce test-open and improve logging on failure in xapi startup and database. code #5704

Merged

Conversation

edwintorok
Copy link
Contributor

I think these are the only changes I have before we'd attempt a merge of feature/perf (with more epoll related content that I'll move to feature/epoll instead).

ocaml/xapi/xapi.ml Outdated Show resolved Hide resolved
Previously the exception would've been completely ignored, so all we've seen in the logs was the
successful connection attempt, and then closing the connection after sending 0 bytes.
We were not seeing that Thread.wait_timed_read raised an exception due to a file descriptor having a value >1024.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
We'll check statically that we are not using Unix.select, but it is good to have a runtime check too,
in case some library (C or OCaml) indirectly uses it.

Default is 0 but can be set to 1024 to test for the absence of Unix.select.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
…rtup failures

If 'server_init' raised an exception previously we wouldn't be able to log the full stacktrace.
Enable backtraces earlier to ensure that we can.

We need to use Debug.with_thread_associated instead of just Backtrace.with_backtraces, because if the thread is not registered,
then xapi-backtrace won't print the backtrace even if it has one.

A startup failure now looks like this in the logs:
```
Jun 19 04:58:41 lcy2-dt72 xapi: [error||0 ||backtrace] Xapi.watchdog failed with exception Unix.Unix_error(Unix.EMFILE, "dup", "")
Jun 19 04:58:41 lcy2-dt72 xapi: [error||0 ||backtrace] Raised Unix.Unix_error(Unix.EMFILE, "dup", "")
Jun 19 04:58:41 lcy2-dt72 xapi: [error||0 ||backtrace] 1/7 xapi Raised at file ocaml/libs/xapi-stdext/lib/xapi-stdext-unix/unixext.ml, line 873
Jun 19 04:58:41 lcy2-dt72 xapi: [error||0 ||backtrace] 2/7 xapi Called from file ocaml/xapi/xapi.ml, line 936
Jun 19 04:58:41 lcy2-dt72 xapi: [error||0 ||backtrace] 3/7 xapi Called from file ocaml/xapi/xapi.ml, line 946
Jun 19 04:58:41 lcy2-dt72 xapi: [error||0 ||backtrace] 4/7 xapi Called from file ocaml/xapi/xapi.ml, line 1535
Jun 19 04:58:41 lcy2-dt72 xapi: [error||0 ||backtrace] 5/7 xapi Called from file ocaml/xapi/xapi.ml, line 1541
Jun 19 04:58:41 lcy2-dt72 xapi: [error||0 ||backtrace] 6/7 xapi Called from file ocaml/xapi/xapi.ml, line 1548
Jun 19 04:58:41 lcy2-dt72 xapi: [error||0 ||backtrace] 7/7 xapi Called from file ocaml/libs/log/debug.ml, line 250
```

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
@edwintorok edwintorok changed the title epoll: 2 small changes epoll: introduce test-open and improve logging on failure in xapi startup and database. code Jun 19, 2024
@psafont psafont merged commit 3d6151b into xapi-project:feature/perf Jun 19, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants