-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add the Miou implementation for caqti #117
base: master
Are you sure you want to change the base?
Conversation
ee64c7f
to
a6cffd4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the initiative, miou support is welcome.
To get the trivia out of the way, I'll need license headers on all OCaml source files, so that they are recorded by Git along with your contribution.
Running the test case, the binding-based drivers seems to work, but there are issues with pgx. I suspect a resource leak.
Thanks, it still is a draft. I try to improve Miou and, at the same time, provide multiple implementations of some libraries. I will set this PR where:
Is it possible to have a reproducible case to check if I missed something? |
Sounds good. I'll return with some details about how to run the testsuite to exercise the pgx driver, which I think is the case which will need debugging. I had some issue myself to run the relevant test in isolation, which I why I was vague about where the nature of the supposed resource leak. I get the impression from the Miou docs that Unikernels is important target, in which case TLS support is highly desirable, as well [Added: ...eventually; it may be easiest to debug the rest first]. That was also one part which needed debugging for resource leaks in the eio driver. In particular the "connect" test was added to find leaks after a connect-disconnect, where I used |
I managed to reproduce the memory contention issue from yesterday as follows: > ulimit -n 2048 -v 2097152
> dune exec testsuite/main_miou_unix.exe -- test -u pgx://@%2fdummy-socket-path
Testing `test_sql_miou_unix'.
This run has ID `LKAMVSGA'.
> [FAIL] pgx 0 post_connect.
[FAIL] pgx 1 expand.
[FAIL] pgx 2 expr.
[FAIL] pgx 3 enum.
[FAIL] pgx 4 table.
[FAIL] pgx 5 tuples.
[FAIL] pgx 6 affected_count.
[FAIL] pgx 7 stream.
[FAIL] pgx 8 stream_both_ways.
[FAIL] pgx 9 stream_binary.
[FAIL] pgx 10 harness.
[FAIL] pgx 11 NOT NULL constraint violation.
[FAIL] pgx 12 UNIQUE constraint violation.
[FAIL] pgx 13 FOREIGN KEY constraint violation.
[FAIL] pgx 14 CHECK constraint violation.
[FAIL] pgx 15 parallel.
... pgx 16 nonlinear.Aborted (core dumped) The problem was that After fixing the URL, the testsuite goes through, but it takes an hour to complete, compared to less that a minute for other variants. Most time is spent in the |
As far as I understand, the |
The updates looks good, except I'll need the license headers as well before merging. I re-tested with sockets, and that's quick, so the slow-down is likely due to the number of packets generated when the output stream is unbuffered. I don't think the stream implementation should be an issue, since for Miou map and bind are just applications. (The The command link I'm using for testing assumes access to a postgresql database. I usually start it up on the system on my workstation (with a database $USER owned by $USER):
Alternatively add the URL(s) to But I also have a script to start up a postgresql server as a regular user, which I consider fixing up and committing to the repo. |
This is a draft which requires the upstream version of Miou which is not yet released but, as far as I can, it works 👍. The TLS implementation is not yet done even if a
tls_miou
implementation exists.