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

WIP: Add new custom event loop for Linux I/O layer #456

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

decarv
Copy link
Contributor

@decarv decarv commented Aug 14, 2024

Introduce ev.h and ev.c, establishing the
foundation for the new custom event loop,
pgagroal_ev.

Replace previous dependencies on libev with the
custom event loop.

Implement support for io_uring with a fallback to
epoll if io_uring is unavailable.

CMakeLists.txt Outdated Show resolved Hide resolved
scripts/build.sh Outdated Show resolved Hide resolved
src/CMakeLists.txt Outdated Show resolved Hide resolved
@jesperpedersen
Copy link
Collaborator

@decarv Rebase, squash, and CI

@jesperpedersen
Copy link
Collaborator

https://github.com/pgmoneta/pgmoneta/tree/main/test

@jesperpedersen
Copy link
Collaborator

@decarv Please, look at the CI

@jesperpedersen
Copy link
Collaborator

Please, see if you can get the liburing version check in place as well

@decarv decarv marked this pull request as draft August 25, 2024 03:31
Introduce ev.h and ev.c, establishing the
foundation for the new custom event loop,
`pgagroal_ev`.

Replace previous dependencies on libev with the
custom event loop.

Implement support for io_uring with a fallback to
epoll if io_uring is unavailable.
@decarv decarv force-pushed the new-linux-io-layer branch 2 times, most recently from f57a6f3 to 4a8a32c Compare September 8, 2024 19:08
}
else
{
pgagroal_log_debug("no ev backends available");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be at an higher level, like warn.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no supported EV backend it should be FATAL and result in exit(1)


if (!strlen(config->ev_backend))
{
pgagroal_log_warn("ev_backend not set in configuration file. Selected default: '%s'", FALLBACK_BACKEND);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a note about the configuration tunable ev_backend, so that the user knows how to configure it.
Also add the configuration setting to the documentation CONFIGURATION.md and friends.

Introduce ev.h and ev.c, establishing the
foundation for the new custom event loop,
`pgagroal_ev`.

Replace previous dependencies on libev with the
custom event loop.

Implement support for io_uring with a fallback to
epoll if io_uring is unavailable.

Update documentation.
@jesperpedersen
Copy link
Collaborator

Run sudo mkdir -p /etc/pgagroal
kernel.io_uring_disabled = 0
pgagroal: PID file </tmp//pgagroal.2345.pid> exists, is there another instance running ?

Issue with shutdown ?

@decarv
Copy link
Contributor Author

decarv commented Sep 15, 2024

pgagroal: PID file </tmp//pgagroal.2345.pid> exists, is there another instance running ?

Yes. I will investigate shutdown issues. However, from the CI output it could be anything, really.

@jesperpedersen
Copy link
Collaborator

Try and a TRACE log file for gcc and clang, and see if there are pointers there...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants