-
Notifications
You must be signed in to change notification settings - Fork 251
a couple of fixes for problems in the code base #578
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
Open
rlehfeld
wants to merge
137
commits into
tomerfiliba-org:master
Choose a base branch
from
rlehfeld:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or 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
…heck if element is in the proxy_cache and getting the element from the cache
… situation can be detected
… from the old actions?
…d stdout must be replaced by devnull as on one hand the code executed could write to it but also we will close the channels and thus cause exit code failures
…n now by default is using ed25519. Further enforce using it in the future so that tests will not break again
…t for the thread termination
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.
Hi,
when using RPyC, I run into a couple of issues. Further, while working on the fix, I run into more issues discovered by the unit tests unrelated to my first changes. Currently all tests are green. I even executed all the tests more than 3000 times to verify everything working reliable (1500 non-bound and 1500 bound thread executions). So here comes the summary of things I detected and fixed.
when using pipes, the sending side might block when nobody is reading from the other side. This problem might happen when working with a pair of pipes especially where one is used for reading and one is used for writing. It might be, that both ends are at the same time writing. This problem is solved through moving the reading to a separate thread. I implemented this only for the unix variant as I am not aware if the same problem exists in the windows world
I detected that in quite some places threads are spawned and later on "joined". Actually the join will be ignored by python if the thread is a daemon thread. As all threads were spawned via the rpyc.lib.spawn this means no thread was actually joined. I fixed this through adding a new interface called worker which will be a non daemon thread and changed the usage at the places were there was a join. Further, I added some more thread cleanups where it was missing. Similar I did with spawn_waitready which was renamed to worker_waitready. All places within the rpyc extensions and the tests should now join with their spawned threads except one situation where we can't. Here I still use a daemon thread for joining with a cleanup thread. But when this situation arises, it means also, that the thread died already.
for bind_threads in the _cleanup, it might be that this is called from one of the worker threads from the thread pool. A worker thread cannot join with itself and this causes the cleanup to through an exception. I fixed this through a detection mechanism that we are in this situation and move the call in this case to a new thread which will not be part of the threadpool. I guess this solves also the original "todo where?" but kept the comment for the moment
for bound threads, the _serve_bounds inside protocol included several races leading to message not being handled or threads not terminating and thus to problems when using join. This problem was visible at least once around every 30 - 250 execution. Since I introduced these changes I executed more than 1500 test loops and no more issues were visible.
the python version given in the matrix of the github pipeline was not used. I adapted the typo and fixed the test_ssl.py tests accordingly. Further, with python 3.14.0 alpha flake8 is broken. I updated to the lastest version which are available on github which means in particular I switched to 3.13 final and 3.14rc1.
fixed the test_gdb.py tests. Gdb functionality must only be called from python from the main thread as otherwise it can and on my linux sytem will cause crashes of gdb. This could be easily solved by switching to OneShotServer. Apart from the, the teardown in the test included a wrong ordering of calls.
fixed a problem with gevent being loaded in tests apart from gevent test through moving the service to a separate process.
instead of using shutdown on a socket in RW direction, now we only do a shutdown in W direction and wait for the peer to detect the shutdown and close or using shutdown in it's own W direction. This solves also the problem with test_ssl.py as now the peer can receive the reason of a failed shutdown reliable.
when calculating timeout, monotonic time should be used in order to be not affected by time deviations e.g. caused by NTP.
as the SSL certificates used for testing expired, I recreated them so that the SSL tests run through again. A proper fix would be to move this into a github pipeline itself so that these certificats are always "fresh"
there is a race in closing and polling threads which leads to an error. This race is solved as well. (actually, this is the thing I wanted to fix in the first place)
Best Regards
PS: the fails in the Spinx test all look like false positives but I could not find out how to handle this
René