-
Notifications
You must be signed in to change notification settings - Fork 73
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
Changes to support Edge Server [API] #2202
base: master
Are you sure you want to change the base?
Conversation
Jenkins builds are failing due to a CMake error:
|
Ubuntu in GitHub CI is failing a test due to a runtime exception:
I know how to fix this... |
Code Coverage Results:
|
Jenkins failures: macOS: The code coverage script push_coverage_results.py blew up somehow. No idea why. Windows: Test "Continuous Super-Fast Push" failed, due to a DatabasePool deadlock:
|
Windows tests appear to be failing now, and linting is needed |
55b1a07
to
2b5a36b
Compare
ad46321
to
6bd2587
Compare
- Removed RESTListener - Misc. internal API additions / changes / fixes
WITH_ERROR can't use Catch's UNSCOPED_INFO(), but I've amended it to use WARN(), which will also show up in the test results.
If the pool is opened with a read-only db, then borrowWriteable() should immediately throw NotWriteable, not wait for a db to be returned and then throw Busy.
c4Replicator+Pool.hh defines factory functions to start a replicator given a DatabasePool* not a C4Database*. This shields callers from having to include c4DatabaseImpl.hh etc., which drag in a buttload of internal replicator headers.
Gives Task subclasses more control over when a finished task should be removed from the listing. Needed for ChangesTask.
Internally, I streamlined the RecordEnumerator API by folding the other initialization parameters into the Options struct.
- ICU is now downloaded as part of the build - No more top level build server CMake wrapper is needed - LiteCore and LiteCoreStatic targets can be disabled to avoid having needless install output - Move sTempDir into LogEncoderTest.cc so it can be shared between CppTests and cbl-logtest
for EdgeServer, as part of creating Etags
It caused errors when LITECORE_BUILD_TESTS or LITECORE_BUILD_SHARED were turned off.
It's a no-op that got left in a commit (27d3530) by accident.
- HTTPLogic::parseHeaders() rejects control characters - Added constant for status 415 - Proper errors in TCPSocket::readHTTPBody()
The index is created lazily. If a collection doesn't have one, an operation using a read-only db from the pool might trigger creating it, which will fail because it's read-only. To work around this, DBAccess's constructor uses the writeable db to call call `getDocumentBySequence` on every collection, forcing the index to be created.
The search for ICU needs to happen on Linux desktop only. Also, ensure that the BUILD_ENTEPRISE flag is properly set now that we don't use the wrapper CMake project anymore (also on Windows this happened)
and bump compiler version to gcc 11 (required for using cbdeps ICU)
When Pusher::sendRevision() fails, it calls doneWithRev(). Both methods were borrowing the db from the pool, so the second borrow deadlocked. Fixed this by having sendRevision release the db before calling doneWithRev. Also added diagnostics to DatabasePool, so when a borrow fails it can identify which thread(s) are using the database.
If a thread that currently has a read-only BorrowedDatabase calls borrow() again, the result will now be a BorrowedDatabase on the _same_ C4Database instance. This doesn't use up any of the other databases in the pool, so it always succeeds. Previously, this could cause a deadlock if all the available dbs were used up. (This is safe because (a) it's on the same thread so there are no concurrency issues, and (b) it's a read-only db so one caller can't make changes that would break the other one.) This eliminates the need for the deadlock workaround I just added to Pusher+Revs.cc, so I've removed it.
If the keyspace explicitly includes "_default" for the collection or scope, it would fail to find the C4Collection.
It didn't think the body was JSON if the content-type was "application/json;charset=utf-8".
Suppresses the following scary lines logged by a TLS server: ERROR: (TLS) mbedTLS(S): mbedtls_ssl_fetch_input() returned -80 (-0x0050) ERROR: (TLS) mbedTLS(S): ssl_get_next_record() returned -80 (-0x0050) ERROR: (TLS) mbedTLS(S): mbedtls_ssl_read_record() returned -80 (-0x0050) WARNING: (WS) ResponderSocket got POSIX error 54 "Connection reset by peer" ERROR: (TLS) mbedTLS(S): mbedtls_ssl_flush_output() returned -80 (-0x0050) ERROR: (TLS) mbedTLS(S): mbedtls_ssl_write_record() returned -80 (-0x0050) ERROR: (TLS) mbedTLS(S): mbedtls_ssl_send_alert_message() returned -80 (-0x0050)
mbedTLS doesn't seem to like two `mbedtls_ssl_context`s performing handshakes simultaneously on different threads, using the same `mbedtls_ssl_config`. It leads to weird RSA private key errors. Using a mutex in TLSContext makes the problem go away. It's not an ideal solution; I may find a better fix if I can find mbedTLS docs on thread-safety.
Even in relatively normal cases, like a client giving up on the handshake or disconnecting, mbedTLS logs a number of scary-looking errors. It's best to just downgrade all the messages from its logging callback to Info or below.
6bd2587
to
219a0c1
Compare
This branch contains all the LiteCore enhancements & fixes needed to implement Edge Server.
IMPORTANT: There are also changes in the EE repo: https://github.com/couchbase/couchbase-lite-core-EE/pull/47
C API Changes:
C4ListenerAPIs
typeapis
field fromC4ListenerConfig, as well as fields specific to REST APIs, like
directory`c4listener_availableAPIs()
api
parameter fromc4listener_getURLs()
serverName
andserverVersion
fields toC4ListenerConfig
; you can leave them NULLc4listener_shareDBWithConfig()
andC4ListenerDatabaseConfig
struct, for db-specific configurationC++ API Changes:
C4Listener::availableAPIs()
api
parameter fromC4Listener::URLs()
C4ListenerDatabaseConfig const*
parameter toC4Listener::shareDB()
C4Collection::getPurgeCount()
C4Database::Transaction::isActive()
C4DocEnumerator
constructor that takes astartKey
parameter.C4Query::parameterNames()
[[nodiscard]]
and/orLIFETIMEBOUND
attributes to some methods. These will intentionally trigger warnings in buggy code; if so, look carefully and fix your code!