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

Merge upstream 0.5.0 #9

Open
wants to merge 105 commits into
base: master
Choose a base branch
from
Open

Merge upstream 0.5.0 #9

wants to merge 105 commits into from

Conversation

zeriyoshi
Copy link

No description provided.

pataquets and others added 30 commits March 29, 2017 19:52
It seems like field->perm might be uninitialized memory
depending on how it is allocated.

I ran into an issue where different sockets had different file
permissions, and some of those sockets weren't readable by the user
which created it.

This behavior probably started in
https://github.com/twitter/twemproxy/pull/311/files
Fix indented bulleted list and add monospaced formatting to command flags within paragraphs
This detects some inconsistent uses of indentation and inconsistent
space after casts, but has a lot more false positives.

https://clang.llvm.org/docs/ClangFormat.html#script-for-patch-reformatting
may be of use for saving time for contributors reformatting new patches
Plugins for editors/IDEs exist that can enforce some of these rules
Add editorconfig matching the c style guide, fix typos in c style guide
Running it in docker makes it easier to run this in other CI providers
and to easily reproduce any failures seen in Travis locally.

Move to python 3
This is useful if the tests hang due to a change.
Otherwise, log capturing would prevent you from seeing the logs.
Run in multiple redis versions

Update some unit tests and reorganize docker build steps
Fix failing unit tests, run in Docker
If hostnames are used instead of ip addresses for all hosts within a pool,
and dns lookup fails, then get/multiget  will hang indefinitely **instead of**
responding with an error such as `SERVER_ERROR Host is down`.
(I expect a client would detect this and close the connection,
but this is not ideal, the client timeout could be a second)

- Both redis and memcache protocols are affected
- If a server resolves but is down, then `get` does respond with `SERVER_ERROR Host is down`.

I suspect that's because memcached get is implemented to coalesce responses
from multiple backend servers, even when there's only one key,
and this is likely a bug specific to handling coalescing when
there's no attempt to send the request to a backend server

Because connection attempts are async but dns lookup is asynchronous,
there's a non-null server connection for a host that's unavailable
but a null server connection for a host that has a dns lookup error,
and these end up using different code paths.
(e.g. the former will call server_close() which does adjust nfrag_sent)

Fixes twitter#596
Travis CI builds have been queueing for hours for some builds.
This a simple docker script.
…ions

Switch to GitHub actions for builds
…erance

Don't hang for dns error responding to fragmented requests
Add a clang-format file approximating the c style guide
ncontinuum is `160 * the number of **non-ejected** hosts` for the ketama
distribution, where 160 is the ketama consistent hashing points per server.
However, the index returned by msg_backend_idx is a number between
0..nservers-1.

- This is a waste of time zeroing out 160 times as much memory as needed
- When there are 0 servers, this previously malloc()ed a pointer of size 0 bytes
  and nutcracker would write to invalid memory.

Also, update redis nosetest expectation because newer redis versions changed the
error message to mention replica instead.

Fixes twitter#563 for redis and memcached.
See the discussion there for more details.
Fragmentation would likely be slower.
It would involve splitting up the request into multiple smaller
requests (allocating and zeroing out an array)
and concatenating strings to rebuild the original request.

Fragmentation is also more likely to be prone to edge cases such as
those mentioned in twitter#597
and twitter#595
…-of-ncontinuum

Use nservers instead of ncontinuum to fix segfault when all hosts are ejected
Always initialize file permissions field for unix domain socket
…len and make sure hostlen is equal or less than KETAMA_MAX_HOSTLEN

Amended version of twitter#567

Amended to remove the trailing null byte when logging
if this does truncate, which shouldn't happen in practice

Co-Authored-By: Tyson Andre <[email protected]>
Co-Authored-By: 李广博 <[email protected]>
TysonAndre and others added 23 commits July 4, 2021 15:39
Fix possible crash copying malformed memcache value responses
Make error messages starting the stats server clearer
The last ubuntu release that this PPA supported was from 2016
(ubuntu 16.10).
If the ppa receives updates, this can be reverted.

Closes twitter#625
Closes twitter#588
Update documentation on running tests, config options, etc.
Update unit test for redis/memcache request testing
Warn about `strdup` being missing during `configure` for libyaml.
(I was checking compatibility with older gcc and should have
used `-std=gnu99`, not `-std=c99`)

Avoid warning about pointer type casts and fallthrough.

Add tests of remaining supported hash functions being compatible with
libmemcached results.
Add miscellaneous tests, fix compilation warnings
See ChangeLog for details.

There have been a lot of changes since 0.4.1 was published in 2015.

I've tested many of these on a fork in combination with the
heartbeat/failover/sentinel patches (planned for 0.6.0)
and expect them to be a significant improvement over 0.4.1,
but there may be build/runtime/packaging issues I'm not aware of on alternate
configurations or OSes.

twemproxy 0.5.0 will use github releases for distribution tarballs
@taka-oyama
Copy link

taka-oyama commented Nov 14, 2022

upstream で入った機能 (zpopmin / zpopmax)を使いたいという要望が来ているので、この PR をさらに最新でリベースしてマージしたいのですが、どういうステータスでしょうか?

@zeriyoshi
Copy link
Author

完全に当時の記憶がなくなっているのと、upstream も結構進んでいるようなのでやりなおしたほうが早そうです

@taka-oyama
Copy link

rebase するのではなく upstream にこちら側で入れた修正を cherry-pick した方が早いかも

@axot
Copy link

axot commented Apr 3, 2024

@taka-oyama 久しぶりです😀 一つ聞きたいのですが、こちらの twemproxy は、今もメンテしていますか?

@taka-oyama
Copy link

してますが、新しい機能とかはあまり考えてない状態です。

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.

9 participants