process hibernate got stuck

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

process hibernate got stuck

Alexander Petrovsky-2
Hello!

Version: Erlang/OTP 22 [erts-10.4.4]

I've process based on gen_statem with follow spawn_opts:

[{spawn_opt, [{priority, low}]}, {hibernate_after, 1000}]

and try to hibernate it along with send timeout events, it seems like:

{keep_state, Data, [{timeout, Data#data.retry_delay, check}, hibernate]}

and I observe, that process got stuck on hibernate call and don't process incoming messages from the mailbox:

1> rp(erlang:process_info(pid(0, 1480, 0), [backtrace, current_stacktrace, current_function, messages])).
[{backtrace,<<"Program counter: 0x00000000009ad4d0 (unknown function)\nCP: 0x00000000009ad4d8 (<terminate process normally>)\n">>},
 {current_stacktrace,[]},
 {current_function,{erlang,hibernate,3}},
 {messages,[{timeout,#Ref<0.2211172348.3436183553.107075>,
                     check}]}]

2> sys:get_state(pid(0, 1480, 0)).
** exception exit: {timeout,{sys,get_state,[<0.1480.0>]}}
     in function  sys:send_system_msg/2 (sys.erl, line 333)
     in call from sys:get_state/1 (sys.erl, line 134)

3> rp(erlang:process_info(pid(0, 1480, 0), [backtrace, current_stacktrace, current_function, messages)).
[{backtrace,<<"Program counter: 0x00000000009ad4d0 (unknown function)\nCP: 0x00000000009ad4d8 (<terminate process normally>)\n">>},
 {current_stacktrace,[]},
 {current_function,{erlang,hibernate,3}},
 {messages,[{timeout,#Ref<0.2211172348.3436183553.107075>,
                     check},
            {system,{<0.3568.0>,#Ref<0.2211172348.3436183554.128263>},
                    get_state}]}]

Can someone help me please?

--
Alexander Petrovsky