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

Reduction of escalus crashes when things go wrong & Timeout parameter accepted #43

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

Conversation

philwitty
Copy link
Contributor

See commit messages for changes

Justification:
As soon as target systems started timing out, or didn't exist we were generating error logs with hundreds of thousands of entries due to having a few thousand concurrent escalus connections running. We instead wanted to record these issues using the onX functions passed as parameters. Have tried to change so all failures in setting up the connection are caught under the connection step and returned with the connection step failing. Inside the clients themselves tried to minimize the chance of mostly badmatches happening, reporting what we can back to the owner. Will freely admit some of the decisions are a bit hacky and not very nice but open to ideas on a better way to do this. We just needed to avoid crashes as much as possible in normal operation (which involves things not going to plan!).

Timeout is self explanatory and should have 0 functional changes if ignored.

* Catch all errors on connection steps
* Exit nicely if transport:init() fails
* On parse error send an error message to owner rather than crash
* BOSH Don't crash on timeout reply to request
@michalwski
Copy link
Contributor

Could you create an empty PR for MongooseIM and ejabberd_tests using your escalus branch?
Here is some doc regarding test branch discovery.

@@ -240,27 +241,33 @@ init([Args, Owner]) ->
Port = proplists:get_value(port, Args, 5280),
Path = proplists:get_value(path, Args, <<"/http-bind">>),
Wait = proplists:get_value(bosh_wait, Args, ?DEFAULT_WAIT),
Timeout = proplists:get_value(timeout, Args, infinity),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

infinity is never a good timeout value. We should approximate infinity with a long, but still finite, number here.

@fenek fenek added the WIP label Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants