Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These are replaced by new config handling and must not be used any
more.
|
|
|
|
|
|
as workarounds to avoid blocking auto-connect,
which is now asynchronous in OTP-21.
Also changed old catch to more efficient try-catch.
|
|
|
|
|
|
This is now ok since sys opens the debug file with encoding utf8.
Conflicts:
lib/stdlib/src/gen_server.erl
|
|
|
|
If the gen_server process needs to perform an action immediately
after initialization or to break the execution of a callback into
multiple steps, it can return {continue, term()} in place of the
time-out or hibernation value, which will immediately invoke the
handle_continue/2 callback with the given term.
This provides a more accessible approach to after initialization
compared to proc_lib+enter_loop that is also guaranteed to be
safe.
It also allows callbacks that need to do lengthy or stateful work
to checkpoint the state throughout multiple iterations. This can
be useful, for example, when implementing behaviours on top of
gen_server.
|
|
|
|
|
|
The state of the gen_server is limited in error events before exiting
(if the Kernel variable error_logger_format_depth is set).
An alternative is to let the error_logger limit all messages
(error_msg, format, warning_msg, info_msg), which would not limit
reports and also add a smallish overhead to event logging.
It is not decided if the alternative is to be implemented.
|
|
Prior to this patch, the stacktrace of an error or
exit in a callback would always be discarded in crash
reports. For example, an exit(crashed) in handle_call/3
would emit:
=CRASH REPORT==== 10-May-2017::14:15:50 ===
crasher:
initial call: gen_server_SUITE:init/1
pid: <0.201.0>
registered_name: []
exception exit: crashed
in function gen_server:terminate/8 (src/gen_server.erl, line 828)
Note that the stacktrace is pointing to the gen_server
internal terminate implementation that calls exit/1.
This patch uses erlang:raise/3 so the stacktrace is not
lost, allowing proc_lib to show the class, reason
and stacktrace coming from the user implementation
(in this case gen_server_SUITE):
=CRASH REPORT==== 10-May-2017::14:16:44 ===
crasher:
initial call: gen_server_SUITE:init/1
pid: <0.197.0>
registered_name: []
exception exit: crashed
in function gen_server_SUITE:handle_call/3 (gen_server_SUITE.erl, line 1529)
This change is completely backwards compatible as
using erlang:raise/3 will still emit the same exit
reason to any linked process and monitor as before.
|
|
Add option hibernate_after to gen_server, gen_statem and gen_event.
Also added to the deprecated gen_fsm behaviour.
OTP14405
|
|
|
|
It was done because "hibernate_after" option already used in ssl for the same reason.
|
|
|
|
gen_event process's.
There is realized gen_server, gen_fsm, gen_event automatic hibernation functionality.
Added unit tests for realized functionality.
Added documentation for auto_hibernate_timeout option.
|
|
|
|
When a gen_server crashes it is in many cases helpful to know in which
context its client made its call.
|
|
* raimo/new-gen-state-machine/OTP-13065: (52 commits)
Add section on state filtering
Promote gen_statem over gen_fsm
Modify code_change/4 to return CallbackMode
Use ?NAME macro in examples
Introduce Fred Herbert suggested additions
Introduce corrections from Fred Hebert and Ingela
Use .png pictures instead of .gif
Write Design Principles chapter
Fix missing short forms for event timeout
Do more intricate Fred Hebert doc changes
Change Caller -> From as suggested by Fred Hebert
Do documentation improvements from Fred Hebert
Fix broken documenation reference
Rename state_timeout -> event_timeout
Fix most of the system docs and emacs mode
Change code_change/4 to {ok,State,Data}
Fixup sharpened test suite
Sharpen test suite
Remove the remove_event action and all alike
Relax caller() type check and cleanup
...
Conflicts:
lib/stdlib/src/gen.erl
lib/stdlib/src/gen_event.erl
lib/stdlib/src/gen_fsm.erl
lib/stdlib/src/gen_server.erl
lib/stdlib/test/error_logger_forwarder.erl
|
|
|
|
|
|
|
|
|
|
This is to prevent dialyzer warning "no local return".
|
|
|
|
If a callback function was terminated with exit/1, there would be no
stack trace in the ERROR REPORT produced by gen_server. This has been
corrected. The actual exit reason for the process is not changed.
|
|
This undocumented option makes an init:get_argument/1 call every time a gen_server
is started.
Reported-By: James Fish
|
|
|
|
The format_status callback (if exists) should always be invoked when
logging errors.
|
|
The functions utilize proc_lib:stop, which in turn utilizes
sys:terminate.
|
|
|
|
Add two new system callbacks Module:system_get_state/1 and
Module:system_replace_state/2 to allow sys:get_state/1,2 and
sys:replace_state/2,3 to operate correctly even if a process is sys
suspended. Modify gen_server, gen_fsm, and gen_event to support the new
callbacks.
If a callback module does not export these functions, then by default the
Misc value (the same as that passed as the final argument to
sys:handle_system_msg/6, and returned as part of the return value of
sys:get_status/1,2) is treated as the callback module's state.
The previous behaviour of intercepting the system message and passing a
tuple of size 2 as the last argument to sys:handle_system_msg/6 is no
longer supported.
Add tests to verify the correctness of sys:get_state/1,2 and
sys:replace_state/2,3 when processes are sys suspended. Add two tests for
modules that implement special processes, one that exports
system_get_state/1 and system_replace_state/2 and one that doesn't.
Much of the credit for this patch goes to James Fish, who reported the
initial problem and implemented much of the fix.
|
|
|
|
A small spelling correction merely; no functionality change.
|
|
|
|
|
|
|
|
* genrich/stdlib/gen_server_typo/OTP-11200:
handle_info Info type possible typo
|
|
|
|
Should it be 'timeout' instead of timeout(), as in doc: http://www.erlang.org/doc/man/gen_server.html#Module:handle_info-2?
|
|
|