开发者

What factors do influence the Catalyst app restart mechanism?

I have a Perl Catalyst application which is launched normally using the -r parameter. I have noticed 2 types of behaviour:

1) the application restarts normally on every "dummy change" of the code (by "dummy change" I mean adding a space or deleting one, smth like this)

2) the application doesn't restart (the same "dummy change"), the "Attempting to restart the server" text is displayed and the app remains blocked in this state (I have to kill it manually)

The behaviour depends on the actual code. It seems there is something related to the code which influences which behaviour acts at one moment. The behaviour is constant, i.e. the same code have one constant behaviour of 2.

The application itself seems to work fine, without any errors or warnings.

How could the code开发者_运维知识库 influence this behaviour? (I mean generally) What factors are related to restart mechanism?


That is because signal handling has changed in the newer version of the Oracle client. Use the "ora_connect_with_default_signals" option to restore default signal handler.

Here is how you can do it in the DBIx::Class model (MyApp::Model::DB):

connect_info => [
    'dbi:Oracle:mydb',
    'username',
    'password',
    {
        ora_connect_with_default_signals => [ 'INT' ],
    },
],

or in the config file:

<Model DBIC>
    connect_info  dbi:Oracle:mydb
    connect_info  username
    connect_info  password
    <connect_info>
        ora_connect_with_default_signals [ INT ]
    </connect_info>
</Model>


I have seen similar behaviour when using a standalone server via PSGI (ie plackup -r), where the server restarts once, and subsequent code changes produce the message but no restart.

However, I have never seen the built-in server myapp_server.pl -r behave in this manner. Any change to a perl module, YAML file etc triggers the restart successfully.

In the brief research I did on it at the time I did turn up this discussion of Plack and restart.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜