Re: [Catalyst] Modify config in a test

2012-09-25 Thread Vladimir Timofeev
2012/9/26 Bill Moseley mose...@hank.org:
 I'm using Catalyst::Test on an app.

 The app has a myapp.yml config which includes configuration for creating an
 instance of a Model component -- and part of that Model's config is a
 database dsn attribute.   When running my test I do want to have the app
 load this config file -- but I want to modify it on-the-fly.

 My test builds a SQLite database when it runs, and I'd like to be able to
 modify the config as (before) Catalyst creates the instance of the model
 component -- that is just filter the config to inject my temporary database.

 The model dsn attribute is readonly -- otherwise I could just do
 MyApp-model( 'MyModel' )-dns( $new_dsn );

 What's a good, clean way of doing this?   Or perhaps a better approach all
 together?

Ohh.. I'am also interested in clean way to do this.
But now in the similar situation, I'm doing this:
(it is from my base test class whitch extends Test::Class itself)

use Class::Load qw(load_class is_class_loaded);
use Class::Method::Modifiers ();
...
sub default_config { return {
... # somewere dsn = 'dbi:SQLite::memory:'
  };
}

sub init : Test(startup) {
  my $self = shift;
  my $app_class = 'MyApp';
  ...
  unless (is_class_loaded($app_class)) {
load_class($app_class);
$app_class-config($self-default_config); # set default config

# filter out some plugins
Class::Method::Modifiers::install_modifier('Catalyst', 'around',
'setup_plugins', sub {
  my $orig = shift;
  my ($class, $plugins) = @_;
  $orig-($class, [grep { ! ( $_ ~~ ['ConfigLoader',some other
plugins] ) } @$plugins]);
});
$app_class-import; # now allow Catalyst properly setup application
# create schema

$app_class-model('General')-schema-deploy({quote_field_names=1,quote_table_names=1});
  }
  ...
}

Hackish, but works...


 --
 Bill Moseley
 mose...@hank.org

 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/




-- 
Vladimir Timofeev vovk...@gmail.com

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst 5.9007 / memcache /high cpu

2012-02-19 Thread Vladimir Timofeev
2012/2/17 Todd Benge todd.be...@trackvia.com:
 Hi,

 We recently updated our web servers to Catalyst 5.9007 with Perl 5.12.

 After the upgrade, we've consistently seen very high cpu on the machines 
 90%.  After much looking, it appears that the apache threads are stuck in
 Cache::Memcached disconnecting.

 We use Catalyst:Plugin::Session::Store::Cache::Memcached and
 Plugin::Session.  We've tried Cache::Memcached::Fast but see random
 segmentation faults.

 So, I'm looking to see if anyone else has seen this problem or may have any
 suggestions?

I've seen similar problems when the connection (to memcached in this
case) was set up before fork. After fork, you can't reuse same socket.
For example: DBIC automatically handle it, by compare saved (on
connect time) pid with current pid, and reconnect when they not equal.


 One option we're considering is moving away from the Memcached session store
 and using DBIC instead?  Any recommendations?

 I appreciate any help.

 Thanks,

 Todd





 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/




-- 
Vladimir Timofeev vovk...@gmail.com

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] [ANNOUNCE] CALL FOR TESTING Catalyst-Runtime 5.80014_01

2009-11-24 Thread Vladimir Timofeev
At first glance all ok. I can't find any encoding issues with my
application (all templates and data in koi8-r). But I do not try to
print any chars, all data - bytes.

On Tue, Nov 24, 2009 at 02:54, Tomas Doran bobtf...@bobtfish.net wrote:
 Hot on the heels of Catalyst-Runtime 5.80014, I'd like to announce a
 development release, Catalyst 5.80014_01.

 This release has a potentially behavior changing fix for the CGI and FastCGI
 engines to do with outputting UTF-8. This fixes a serious bug with
 outputting utf-8 pages using Catalyst::Plugin::Unicode::Encoding at least..

 I _NEED_ people using FastCGI and dealing with high bit characters in their
 applications to test this release for me and let me know if they see any
 issues. If you do see any issues in your app which previously worked with
 any other 5.80 version, please reply to this mail or log a bug in RT.

 You can try it out by typing:
 cpan -i BOBTFISH/Catalyst-5.80014_01.tar.gz

 The changelog is included below as usual. Thanks in advance to anyone
 helping test this release.

 Cheers
 t0m

 --
 5.80014_01 2009-11-22 20:01:23

  Bug fixes:
   - Filehandle now forced to binmode in CGI and FastCGI engines. This
 appears
     to correct some UTF-8 issues, but may break people's code which relies
     on the old behaviour.

  Refactoring / cleanups:
   - Plugins which inherit from Catalyst::Controller or Catalyst::Component
     are deprecated and now issue warnings.


 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/




-- 
-- vovkasm

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] how do i truss an catalyst FCGI worker process?

2008-10-29 Thread Vladimir Timofeev
Hi

On Wed, Oct 29, 2008 at 14:50, Oleg Pronin [EMAIL PROTECTED] wrote:
 Hi.

 I need to inspect my fcgi process, so i tried to do
 truss -p fcgi_worker_pid
 But fcgi process immediately exits when truss just starts.

 Does anyone know why does it happen and how to get it to work?

According to ptrace(2) used by truss:

  For the duration of the tracing session, the traced process will be
  ``re-parented'', with its parent process ID (and resulting behavior)
  changed to the tracing process.

And child exit after processing first request, because it's thinking
that manager die
(see FCGI::ProcManager pm_post_dispatch sub).

May be, for only debugging reason, you can temprorary off this check?


 Please anybody, try to do
 truss -p fcgi_worker_pid
 on standalone (not in apache) fcgi catalyst server.

Of course this work ;-)


 Thanks.

 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/