Commit Graph

130 Commits

Author SHA1 Message Date
Sergei Shuvatov
8b8c0e2779
MSPF-532: fix check for UTC in RFC 3339 date and time (#132) 2020-02-18 19:35:33 +03:00
Sergei Shuvatov
3ddd842a33
MSPF-532: get rid of rfc3339 lib (#131) 2020-02-17 19:36:29 +03:00
Sergey Yelin
d55dbf551a
HG-534: Fix 'unknown message error' in event handler (#130)
* HG-534: Fix 'unknown message error' in event handler

* Revert "HG-534: Fix 'unknown message error' in event handler"

This reverts commit efd6c51129adeca1369296f360f3e931732f5c76.

* HG-534: Fix unknown message error

* More accurate test

* Fix lint error
2020-02-14 21:56:29 +03:00
Toporkov Igor
ed644d7d70
MSPF-490: Monitor to detect client disconnection (#111)
* Monitor to detect client disconnetion on server side

* Renaming save_woody_state

* Rework monitor to use one per connection

* Changed event type

* wip: stream handler skeleton

* wip: log abnormal termination

* Upgrade cowboy to 2.7.0

* Finish migration to stream_handler

* Upgrade more dependencies

* Fix state type, remove early_error logging

* rename woody_monitor to comply with cowboy naming

* remove redundant monitor pid from state

* Log only socket errors

* wrap put_woody_state

* experimental: monitor for woody_events

* add missing update

* match on handle_event return, don't monitor tracing

* Rework update_woody_state

* Slightly increase min_complexity in linter config

* Make event state transition explicit

* Remove handle_event wraper

* Revert "Slightly increase min_complexity in linter config"

This reverts commit 38301e3b5b66967cb08c0bf7f27a2a8042a40a19.

* match unmetched returns

* Add test

* Erase trailing whitespace

* Refactor test

* Delete mistakenly added file

* Rename function

* Review fixes

* Match supervisor return

Co-Authored-By: Andrew Mayorov <a.mayorov@rbkmoney.com>

Co-authored-by: Andrew Mayorov <encube.ul@gmail.com>
2020-02-05 14:35:43 +03:00
Andrew Mayorov
295b864cf7
Host processes under tc_sup in tests (#129)
To avoid piling ct logs up with error report noise.
2020-02-05 14:14:08 +03:00
Andrew Mayorov
309ac51655
Fix service result event formatting (#128)
* Switch to public dep upstream
2020-02-04 19:44:37 +03:00
ndiezel0
e46a3b6303
Bump how_are_you (#127) 2020-01-30 19:40:57 +03:00
Andrew Mayorov
f2e56d8aff
Make exception formatting heuristics cleaner (#126) 2020-01-27 17:26:39 +03:00
Sergey Yelin
ce178d0232
Remove extra get_formatter_opts/1 (#125)
* Remove extra get_formatter_opts/1

* Change defaults to max length and max printable string length

* Typo
2020-01-14 09:40:50 +03:00
Andrew Mayorov
205982e6c0 Fix max_printable_string_length typo (#124) 2020-01-09 16:34:47 +03:00
Andrew Mayorov
307cd7b860
Make printability test more precise and conservative (#123) 2019-12-31 17:16:23 +03:00
Andrew Mayorov
e615c85d70
Implement binary-first event formatter (#122)
* Add compex term formatting microbenchmark
* Format FP numbers more neatly
* Provide fast-path verbatim term formatter
* Add memory pressure benchmark runner
* Switch to rebar3_bench 0.2.1 package
* Employ assert macros throughout main ct suite
2019-12-31 12:52:56 +03:00
Sergey Yelin
f74bb6854c
Remove whitespaces (#120)
* Remove whitespaces

* Typo
2019-12-12 19:02:16 +03:00
Sergey Yelin
2dc2ed1297
Add naive bench for formatter (#119)
* Add naive bench for formatter

* Review fixes
2019-12-11 19:07:16 +03:00
Sergey Yelin
07f8cee915
AAA-54 Improvements 3 (#118)
* Don't breal unicode

* Monir optimizations

* Strict strings via options

* Do not wrap call

* Add '...' to cuted lines

* Replace whitespace with single space

* Typo

* Typo

* Remove io_lib:format from hot path where possible
2019-12-11 18:09:25 +03:00
Sergey Yelin
6cfda6790f
Aaa 54 improvements 2 (#117)
* Don't breal unicode

* Monir optimizations

* Strict strings via options

* Do not wrap call

* Add '...' to cuted lines

* Replace whitespace with single space

* Typo

* Typo
2019-12-10 17:51:38 +03:00
Sergey Yelin
b48a03ffaf
AAA-54: Improvements (#116)
* Pass union value properly

* Fix exception handling for simple benary messages

* Fix and cleanup test

* Add missing format_as_exception to meta_client()

* Typo

* Remove debug code

* Rework maps formatting

* Introduce thrift's void

* Typo

* Retuen Value for void type
2019-12-09 12:22:41 +03:00
Sergey Yelin
068bc4b3b7
Aaa 54 fix exception formatting (#115)
* Pass union value properly

* Fix exception handling for simple benary messages

* Fix and cleanup test

* Add missing format_as_exception to meta_client()

* Typo
2019-12-04 14:11:32 +03:00
Sergey Yelin
59ec572466
Add depth and limit to formatter (#110)
* Force print trace_id and Co

* Use integer control char for formtatting numbers

* Sync

* Fix format for "wrong" struct

* Replace string formatting with inplace string representation

* Replace foldl with tail call

* Added opts comntainer

* Add formatting with depth

* Simplify depth increment

* More depth tests

* Format test data

* lint fixes

* Fix dialyzer errors

* Introduce current_length and max_length

* Add first tests for max_length

* Add length options

* Fix state in format_struct

* Fix test

* Move depth to stack from state

* Move length from state to stack

* Added more test on chars limit

* More tests

* Try to log more data nj logs

* Cleanup

* Fix line count in arguments

* Add missing formatted text in list and map

* Add comment to raw_string

* Formating

* Replace format with concatenation

* Fix dialyzer errors

* Fix lint errors

* Ignore false positives

* Added tests for max_length and max_depth

* Let logger decide how to format data in case of error

* Add formatter options to meta

* Fix lint error

* Increase complexity for dont_repeat_yourself

* Increase compliexity - 2

* Decrease complexity to minimal for current codebase

* Do not add '...' if no more argemunts in call

* Unify arguments for maybe_add_delimiter and may_be_add_more_marker

* Fix formating for list/set/map

* Simplify format build

* Log error

* Review fixes

* Move formatter options to environment

* Minor fixes and code cleanup

* Fix Opts

* Review fix

* Rework exception handling

* Move list and set format to separate functions

* Fix possible injection

* Eliminate possible badmatch

* Allow more complex dry

* Add test for sets

* Rework list formatter

* More strict limit for length

* Minor cleanup

* Remove unreachable code

* Switch back to formatter

* Remove unneeded flatten

* Do not format last list element if there is no room for it

* Remove unused Param

* Fix

* Simplify formatting call

* Add missing delimiter length

* Fix woody_event_formatter:format_reply/3

* Cleanup

* Add Opts to formatters

* Make skip message compact

* use ~w instead of ~p

* Typo

* Add formatter_opts to woody:options()

* Rework options

* Added escape for "'"

* Rework tests

* Fix tests

* Rework
2019-12-03 16:12:17 +03:00
Andrey Fadeev
c227e3410b
Add ehostunreach client error handling (#114) 2019-09-30 17:47:47 +03:00
Sergey Yelin
281fef35ff
Remove support for pre-Elrang21 stacktraces (#113)
* Remove support for pre-Elrang21 stacktraces

* Prepare for Erlang 22
2019-09-26 12:13:53 +03:00
Anton Kuranda
57ab12266f
Let's make it opensource (#112) 2019-09-20 17:48:39 +03:00
Sergey Yelin
6136395b87
AAA-54: Add event formatter (#109)
* AAA-54: Add event formatter

* More tests enabled

* Fix list of unoins

* Fix list of structures test

* Added reply formatter

* Enable another reply test

* Fix format error

* Add reply formatting

* Enable cover

* Add missing Value types

* Fix formattin typo

* Fix lint errors

* More formatting

* Fix dialyzer error

* Fix enum format

* Simplify format rules for enum

* Add unit type to log

* Add more info for union

* Remove unused wxtra formatting

* Use compact formatting rules for unknown data

* Simplify formatting

* Refactor formatting

* Add set formatting

* Move request formatting to woody_event_formatter

* Move reply formatting to woody_event_formatter

* Module cleanup

* Fix lint errors

* Fix dialyzer errors

* Add exception handling

* Fix remove custom msgpack formatting

* Add more non-printable string detection merthods

* Better name for formatting function

* Make BERT comment more valuable

* Skip middle elements in long lists

* Typo in comment

* Stick with latest damsel and mg_proto for tests

* Fix damsel commit

* Replace hand made printable function with standard

* Check full string to avoid false positives

* Allow unicode strings

* Add comment

* Mark "broken" binary data as non-printable

* Fix lint
2019-08-26 12:00:47 +03:00
Toporkov Igor
358ba355f6
MSPF-498: Handle terminate correctly (#108)
* Handle terminate correctly

* Renamed State to Opts
2019-08-09 13:14:25 +03:00
Toporkov Igor
649a8aba30
Created hay handler to monitor connections (#104)
* Created hay handler to monitor connections

* Review fixes #1

* Added hay as app dependency

* Created metrics receiver for hackney

* Removed filtering, added key tagging

* Added metrics to tests

* Removed non list key tagging option

* Refactored metric updates

* Moved hay to test deps

* Strictened allowed metrics, enabled key mapping

* Added privkey to dialyze CI step

* Reordered privkey

* Changed cache location

* Hardcoded allowed metrics

* Use tag for test deps

* Collect info for all ranch listeners
2019-07-05 16:31:58 +03:00
Sergei Shuvatov
5ee89dd0b2
CDS-64: pass client cert through woody context (#107) 2019-06-24 19:44:45 +03:00
Sergey Elin
8a6822462a
MSPF-460: Update thrift compiler plugin (#105)
* MSPF-460: Update thrift compiler plugin

* More cleanup

* Erlang 21.3.8.4

* Use new plt file for dialyzer
2019-06-20 18:00:29 +03:00
Sergey Elin
f0df3414cf
MSPF-458: Fix ssl SUITE tests (#106)
* MSPF-458: Fix ssl SUITE tests

* MSPF-458: Remove extra newline
2019-06-19 18:32:52 +03:00
Sergei Shuvatov
a4921bde49
CDS-64: add options for SSL support (#103)
* Get rid of acceptors_pool_size environment variable
* Fix end_per_testcase/2 in the main test suite
2019-06-06 13:11:48 +03:00
Andrey Fadeev
3fd2111537
HG-484 Update thrift (#102) 2019-05-30 18:44:37 +03:00
Andrey Fadeev
26e2c35e2c
Fix deadline_reached error handling in client timeout calculation (#101) 2019-05-23 12:55:55 +03:00
Sergey Elin
1f72c9b1e3
MSFP-433: Fix badmatch in case of header error (#100) 2019-05-15 17:04:57 +03:00
Sergey Elin
fbc129db1f
MSFP-433: Fix some errors found by dialyzer (#99) 2019-05-15 12:17:55 +03:00
Sergey Elin
eae1fd1cf1
HG-433: Pass Id to make_server_childspec/1 (fix crashes in hellgate) (#98) 2019-05-06 21:23:13 +03:00
Toporkov Igor
f9f15cb36e
MSPF-439: Add multiple event handlers spec (#97)
* Fixed event handler specs

* Spec fix

* Split very long line

* Added type for multiple handlers
2019-05-06 11:33:26 +03:00
Andrey Fadeev
698a842967
MSFP-432 Fix logger formatter compatibility (#96)
Convert URL from iodata() to binary() according woody url type
2019-04-22 22:18:14 +03:00
Andrey Fadeev
749a3ab309
Allow binary url (#95) 2019-04-22 18:16:35 +03:00
Andrey Fadeev
90eca45089
Add more details to unsupported_url_scheme resolver error (#94) 2019-04-19 20:29:30 +03:00
Alexey
533d2a6d81
MSPF-429: Graceful shutdowns (#89) 2019-04-19 14:18:32 +03:00
Sergey Elin
09506cdd10
MSPF-413: Add execition_time (#92)
List of changes:
* Use thrift plugin compiler 0.3.0
* Update build_tools to latest
* Update build image to Erlang 21
* Added execution_start_time, execution_end_time, execution_duration_ms to woody state
2019-04-19 10:08:35 +03:00
Sergei
d0ac788d95
OTP 20 compatibility (#93) 2019-04-18 17:54:16 +03:00
Andrey Fadeev
cf9dc0dad5
Add predefined ip pickers (#91) 2019-04-10 21:07:38 +03:00
Andrey Fadeev
4f85c9be4d
Add checkout_timeout hackney error processing (#90) 2019-04-10 19:47:41 +03:00
Andrey Fadeev
c396f927b5
MG-155 Improve resolving (#88)
Update hackney to version with fixed hostname normalization.
Add resolving both ipv4 and ipv6 only addresses.
2019-04-02 18:00:07 +02:00
Toporkov Igor
862358ee62
MSPF-428: Erlang OTP 21 to master (#86)
* MSPF-394/Migrate woody_erlang to cowboy 2.5.0 (#82)

* Renewed some old cowboy syntax

* Reworked types to fit new cowboy/ranch versions

* Replaced cowboy tuples with separate values

* Fixed types, deleted testing logs, deleted redundant errors

* Moved to new StackTrace retrieval syntax for Erlang/OTP 21

* Restored default config, fixed typing

* Cleaned unnessesary changes, removed export_all

* Restored genlib cached version

* Downgraded to old stacktrace retrieval syntax, fixed codestyle

* Restored new StackTrace retrieval syntax, updated build image

* Changed rebar3 version for CI

* Corrected typing and spelling, removed unnessesary supervisor

* Created stream handler to replace hooks

* Added options for reading body

* Simplified stream handler

* Fixed wrong module name, added read body options support in stream handler

* Puted read body opts to env, renamed stream handler

* Codestyle, types and config fixes

* Moved response tracing to a separate function, now tracing failed requests too

* Changed options to map (#83)

* Fixed wrong timeout override logic (#84)

* Patch merge conflict

* Bump dependencies  (#87)

* bumped hackney

* bumped erlang thrift commit
2019-03-28 17:52:17 +03:00
Alexey
4f5f7337e6
MSPF-416: No aggressive keepalives (#85) 2019-03-28 13:37:37 +03:00
Andrey Fadeev
d8de03d34a
Remove unexist meta usage in client event formatter (#81) 2018-11-09 12:40:20 +03:00
Andrew Mayorov
71475b5d3d
Relax test assertion to make it realistic (#80)
* Update README with mentions of new and updated options
2018-11-07 15:37:24 +03:00
Andrew Mayorov
7a57a10d02
Expose ranch transport opts (#79)
It will allow library users to tune things like number of max allowed concurrent connections.
2018-11-07 12:54:54 +03:00
Andrey Fadeev
8458d1c0c9
MSPF-397 Use OS time for deadline calculation (#78)
*  Use OS time for deadline calculation
Erlang system time may differ from OS time after OS time changes.
For example, try to run Erlang node, change system time and run
> erlang:system_time(millisecond) - os:system_time(millisecond).
See http://erlang.org/doc/apps/erts/time_correction.html#time-warp-modes for details

* Use OS time for cache lifetime as cache library do
2018-11-02 13:47:37 +03:00