-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
chore(db) connector:close and connector:setkeepalive cleanup #4218
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make our methods that return all targets at once to return up to 1000 at once, instead of the default of 100.
Do not raise an error when the target is not found, aligning it with other "select" methods.
Changes: * Returning a negative ttl value from the L3 callback will now make the fetched data bypass the cache (it will still be returned by get()). This is useful when some fetched data indicates that it is not cacheable. * When get() returns a value from L2 (shm) during its last millisecond of freshness, we do not erroneously cache the value in L1 (LRU) indefinitely anymore. * When get() returns a previously resurrected value from L2 (shm), we now correctly set the hit_lvl return value to 4, instead of 2. Full Changelog: https://github.com/thibaultcha/lua-resty-mlcache/blob/master/CHANGELOG.md From #4216
In the init phase, lua-cassandra fallbacks to LuaSocket (since cosockets are not supported). When we ask Kong to connect to the C* peers over TLS, we use LuaSec. LuaSec wraps the LuaSocket TCP object (which itself wraps the kernel socket). LuaSocket normally returns `1` when calling `sock:close()`, but when wrapped by LuaSec, the latter dismisses that return value, and thus, `sslsock:close()` does _not_ return anything. We could work around this limitation by providing an additional fix to the pgmoon and lua-cassandra LuaSocket metatable wrappers, but this commit presents a faster fix for the sake of efficiency, in the spirit of the 1.0.2 release. Note also how we changed the return value of `db_conn:close()` to `true` when no stored connection is found. While not following the initial design of this API, this changes will help prevent misuses in higher-level modules (such as the DAO). Fix #4212 From #4214
There is no need to assert whether we closed the DB connection. If it isn't the case, this won't prevent Kong from starting nor functioning normally.
bungle
force-pushed
the
chore/db-close-keepalive
branch
3 times, most recently
from
January 18, 2019 19:50
4921f62
to
a06044e
Compare
Make both Postgres and Cassandra database connectors behave similarly on `connector:close` and `connetor:setkeepalive`. Also adds tests for the mentioned methods + :connect, including tests with ssl connection.
bungle
force-pushed
the
chore/db-close-keepalive
branch
from
January 18, 2019 20:05
a06044e
to
c81d2c9
Compare
thibaultcha
force-pushed
the
release/1.0.2
branch
from
January 18, 2019 23:06
80703aa
to
03dfacf
Compare
thibaultcha
pushed a commit
that referenced
this pull request
Jan 18, 2019
Make both Postgres and Cassandra database connectors behave similarly on `connector:close` and `connetor:setkeepalive`. Also adds tests for the mentioned methods + :connect, including tests with ssl connections. From #4218 Signed-off-by: Thibault Charbonnier <[email protected]>
Manually merged, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Make both Postgres and Cassandra database connectors behave similarly on
connector:close
andconnetor:setkeepalive
.Also adds tests for the mentioned methods + :connect, including tests with ssl connection.
This is continuation of the work to make the fix to #4212 be catched with our test suite, if it ever happens again.