mmoreram / GearmanBundle

GearmanBundle for Symfony2
MIT License
236 stars 103 forks source link

Env Specific Configuration Fails #60

Open bmeynell opened 10 years ago

bmeynell commented 10 years ago

When defining servers in app/config/config.yml everything works as expected. However, if different settings exist in app/config/config_prod.yml the workers fail to communicate correctly with gearmand. In this case the workers display suspicious configuration output:

    @worker\servers :

        #task1 - 10.57.23.24:4730
        #0 - 127.0.0.1:4730

    @Worker\description :

        Works sms-related jobs

The line above - #0 - 127.0.0.1:4730 should not exist. What is it? The workers attempt to connect to local host but cannot because gearmand is on a separate machine, which results in this error:

  [GearmanException]              
  Failed to set exception option

The only temporary solution is to remove gearman settings from all files except for config.yml.

mmoreram commented 10 years ago

Can you paste please your config.yml and your config_prod.yml please? - Only bundle related pieces

bmeynell commented 10 years ago

config.yml:

gearman:                                                                        
    bundles:                                                                    
        FooBundle:                                                           
            name: MyFooBundle                                      
            active: true                                                        
            include:                                                            
                - Service                                                       
            ignore:                                                             
                - EventListener                                                 
                - DependencyInjection                                           
                - Resources                                                     
        BarBundle:                                                             
            name: MyBarBundle                                        
            active: true                                                        
            include:                                                            
                - Workers                                                       
            ignore:                                                             
                - EventListener                                                 
                - DependencyInjection                                           
                - Resources                                                     
        BazBundle:                                                            
            name: MyBazBundle                                       
            active: true                                                        
            include:                                                            
                - Service                                                       
            ignore:                                                             
                - EventListener                                                 
                - DependencyInjection                                           
                - Resources                                                     
    defaults:                                                                   
        method: doNormal                                                        
        iterations: 150                                                         
        callbacks: false                                                        
    servers:                                                                    
        gearman1:                                                               
            host: 127.0.0.1                                                     
            port: 4730 

config_prod.yml:

gearman:                                                                        
    servers:                                                                    
        task1:                                                                  
            host: 10.12.24.26                                                   
            port: 4730
mmoreram commented 10 years ago

Can you please test this fix?

Thks!

bmeynell commented 10 years ago

This issue is still occurring. Updated the issue above a bit.

mmoreram commented 10 years ago

Hmm let me see... gonna work right now on it.

mmoreram commented 10 years ago

I cannot find any kind of error anymore.

Can you paste again your config if changed and your output?

bmeynell commented 10 years ago

Error still exists. I have to remove the gearman server information from config.yml to get it to work.

mmoreram commented 10 years ago

Yes, sure, but I can not do anything until I have real information about your environment... you can also try to fix it.