Just put these two lines before using grit ...

    Grit::Git.git_timeout = 120 // timeout in secs
    Grit::Git.git_max_size = 2 * 5242880 // size in bytes


On Wednesday, August 8, 2012 1:15:08 AM UTC+2, Bert JW Regeer wrote:
>
> In this commit 
> http://gitorious.org/gitorious/mainline/commit/5fd9a19f30aa8aac64ac3f02462c93e3b5ca1da6/diffsa
>  change was made to add the commit diff to the body of the email, along 
> with a link to view the commit online.
>
> This works perfectly for cases where the patchset isn't larger than 5 MB 
> or it doesn't hit the Grit timeout, but unfortunately that doesn't seem to 
> be the case with some of the changes that my users are pushing.
>
> I think it would be appropriate to wrap the function diff_body() as it is 
> in 
> http://gitorious.org/gitorious/mainline/blobs/master/lib/event_rendering/text.rb#line321with
>  a catch for the Grit timeout, and return an appropriate message 
> stating that the diff is too large for email or could not be processed 
> (much like when trying to view a diff that is too large via the web). This 
> way the poller wouldn't fail and send two messages to the sys-admin when in 
> reality there is not a whole lot that can be done about this issue.
>
> My ruby-foo isn't strong enough to go make the modifications myself, but 
> if someone could supply a patch I would be more than happy to throw it into 
> use on my production instance and see if it at least helps solve the issue 
> somewhat.
>
> Thanks,
> Bert JW Regeer 
>
> On Thursday, 2 August 2012 17:56:24 UTC-6, Bert JW Regeer wrote:
>>
>> This exception keeps getting thrown, now I don't understand why, and I 
>> have no idea how to even start debugging the situation. Let me describe the 
>> hardware I am running on and some basic stats about the repository, if you 
>> guys have any ideas as to where I can start looking i'd appreciate that.
>>
>> Hardware:
>>
>> 2 CPU's with 2 cores is a total of 4 cores.
>> 16 GB of RAM
>> 4 x SATA drive (2 drives in an MD raid 1, and 2 more drives in an MD raid 
>> 1)
>>
>> The git repositories are sitting on the second md raid 1.
>>
>> The repository stats:
>>
>> Commits: 3402
>> .git size on fresh clone: 33M
>> Files in repo: 835
>> Directories: 343
>>
>> Worst case I will most likely increase the Grit timeout to 20 or even 30 
>> seconds in an attempt to stave off this issue for a little while, although 
>> I have a bad feeling this will continue...
>>
>> Thanks,
>> Bert
>>
>> An exception occured in #<PushProcessor:0x7f211f011980
>>  @repository=
>>   #<Repository id: 51, name: "<scrubbed>", project_id: 2, user_id: 7, 
>> created_at: "2011-07-20 23:31:31", updated_at: "2012-08-02 02:02:31", 
>> parent_id: 17, ready: true, kind: 3, owner_type: "User", owner_id: 7, 
>> hashed_path: "<scrubbed>", description: nil, last_pushed_at: "2012-08-02 
>> 02:02:31", wiki_permissions: 0, deny_force_pushing: false, 
>> notify_committers_on_new_merge_request: true, last_gc_at: nil, 
>> merge_requests_enabled: true, disk_usage: 46292359, push_count_since_gc: 
>> 706>,
>>  @spec=
>>   #<PushSpecParser:0x7f211eff8868
>>    @from_sha=
>>     #<PushSpecParser::Sha:0x7f211eff8700
>>      @sha="95e177ae088c5d365d1c7f88e8f8ac7aac50db3b">,
>>    @ref=
>>     #<PushSpecParser::Ref:0x7f211eff8480 @name="BUGFIX", @type="heads">,
>>    @to_sha=
>>     #<PushSpecParser::Sha:0x7f211eff8520
>>      @sha="0c1d189d13a38d53e17bc7b80bb68c0a2294d7b4">>,
>>  @user=
>>   #<User scrubbed for security>>
>> !
>>
>> Grit::Git::GitTimeout: Grit::Git::GitTimeout
>>
>> storage/git/gitorious/vendor/grit/lib/grit/git.rb:101:in `sh'
>>         /storage/git/gitorious/vendor/grit/lib/grit/git.rb:71:in `run'
>>         /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
>>         /storage/git/gitorious/vendor/grit/lib/grit/git.rb:70:in `run'
>>         /storage/git/gitorious/vendor/grit/lib/grit/git.rb:57:in 
>> `method_missing'
>>         /storage/git/gitorious/lib/event_rendering/text.rb:322:in 
>> `diff_body'
>>         /storage/git/gitorious/lib/event_rendering/text.rb:318:in 
>> `add_diff_content'
>>         /storage/git/gitorious/lib/event_rendering/text.rb:243:in 
>> `render_push_summary'
>>         /storage/git/gitorious/lib/event_rendering/text.rb:104:in `render'
>>         /storage/git/gitorious/lib/event_rendering/text.rb:31:in `render'
>>         /storage/git/gitorious/app/models/favorite.rb:63:in 
>> `notify_about_event'
>>         /storage/git/gitorious/app/models/event.rb:166:in 
>> `notify_subscribers'
>>         /storage/git/gitorious/app/models/event.rb:165:in `each'
>>         /storage/git/gitorious/app/models/event.rb:165:in 
>> `notify_subscribers'
>>         
>> /storage/git/gitorious/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in
>>  
>> `send'
>>         
>> /storage/git/gitorious/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in
>>  
>> `evaluate_method'
>>         
>> /storage/git/gitorious/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in
>>  
>> `call'
>>         
>> /storage/git/gitorious/vendor/rails/activesupport/lib/active_support/callbacks.rb:93:in
>>  
>> `run'
>>         
>> /storage/git/gitorious/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in
>>  
>> `each'
>>         
>> /storage/git/gitorious/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in
>>  
>> `send'
>>         
>> /storage/git/gitorious/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in
>>  
>> `run'
>>         
>> /storage/git/gitorious/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in
>>  
>> `run_callbacks'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/callbacks.rb:344:in
>>  
>> `callback'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/callbacks.rb:267:in
>>  
>> `create'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/base.rb:2876:in
>>  
>> `create_or_update_without_callbacks'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/callbacks.rb:250:in
>>  
>> `create_or_update'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/base.rb:2540:in
>>  
>> `save_without_validation'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/validations.rb:1078:in
>>  
>> `save_without_dirty'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/dirty.rb:79:in
>>  
>> `save_without_transactions'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/transactions.rb:229:in
>>  
>> `send'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/transactions.rb:229:in
>>  
>> `with_transaction_returning_status'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in
>>  
>> `transaction'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in
>>  
>> `transaction'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/transactions.rb:228:in
>>  
>> `with_transaction_returning_status'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/transactions.rb:196:in
>>  
>> `save'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in
>>  
>> `rollback_active_record_state!'
>>         
>> /storage/git/gitorious/vendor/rails/activerecord/lib/active_record/transactions.rb:196:in
>>  
>> `save'
>>         /storage/git/gitorious/lib/push_event_logger.rb:55:in 
>> `create_push_event'
>>         /storage/git/gitorious/app/processors/push_processor.rb:53:in 
>> `process_push'
>>         /storage/git/gitorious/app/processors/push_processor.rb:41:in 
>> `on_message'
>>         /storage/git/gitorious/lib/gitorious/messaging.rb:82:in `consume'
>>         
>> /storage/git/gitorious/lib/gitorious/messaging/stomp_adapter.rb:96:in 
>> `on_message'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/activemessaging-0.7.1/lib/activemessaging/processor.rb:32:in
>>  
>> `process!'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/activemessaging-0.7.1/lib/activemessaging/gateway.rb:232:in
>>  
>> `_dispatch'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/activemessaging-0.7.1/lib/activemessaging/gateway.rb:151:in
>>  
>> `execute_filter_chain'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/activemessaging-0.7.1/lib/activemessaging/gateway.rb:231:in
>>  
>> `_dispatch'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/activemessaging-0.7.1/lib/activemessaging/gateway.rb:222:in
>>  
>> `each'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/activemessaging-0.7.1/lib/activemessaging/gateway.rb:222:in
>>  
>> `_dispatch'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/activemessaging-0.7.1/lib/activemessaging/gateway.rb:207:in
>>  
>> `dispatch'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/activemessaging-0.7.1/lib/activemessaging/gateway.rb:204:in
>>  
>> `synchronize'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/activemessaging-0.7.1/lib/activemessaging/gateway.rb:204:in
>>  
>> `dispatch'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/activemessaging-0.7.1/lib/activemessaging/gateway.rb:45:in
>>  
>> `start'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/activemessaging-0.7.1/lib/activemessaging/gateway.rb:32:in
>>  
>> `start'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/activemessaging-0.7.1/lib/activemessaging/gateway.rb:31:in
>>  
>> `each'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/activemessaging-0.7.1/lib/activemessaging/gateway.rb:31:in
>>  
>> `start'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/activemessaging-0.7.1/lib/activemessaging.rb:111:in
>>  
>> `start'
>>         /storage/git/gitorious/lib/gitorious/messaging/stomp_poller.rb:14
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/daemons-1.1.0/lib/daemons/application.rb:203:in
>>  
>> `load'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/daemons-1.1.0/lib/daemons/application.rb:203:in
>>  
>> `start_load'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/daemons-1.1.0/lib/daemons/application.rb:292:in
>>  
>> `start'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/daemons-1.1.0/lib/daemons/controller.rb:73:in
>>  
>> `run'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/daemons-1.1.0/lib/daemons.rb:143:in
>>  
>> `run'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/daemons-1.1.0/lib/daemons/cmdline.rb:112:in
>>  
>> `call'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/daemons-1.1.0/lib/daemons/cmdline.rb:112:in
>>  
>> `catch_exceptions'
>>         
>> /storage/git/gitorious/vendor/bundle/ruby/1.8/gems/daemons-1.1.0/lib/daemons.rb:142:in
>>  
>> `run'
>>         script/poller:30
>>
>

-- 
-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to