Basically... the class variable is shared by all instances of the controller in question spawned by the Rack server process. Multithreaded Rails handles multiple requests simultaneously, and thus multiple simultaneous instances of the controller. Two requests come along, one from 1.1.1.1, then one from 2.2.2.2 immediately after. before_filter from 1.1.1.1's controller instance sets class variable accordingly, then before_filter from 2.2.2.2's instance overwrites the variable. Controller instance from 1.1.1.1 now uses 2.2.2.2's IP, and shinanagins ensue.
On Jun 10, 5:05 pm, Colin Law <clan...@googlemail.com> wrote: > 009/6/10 Jodi Showers <j...@nnovation.ca>: > > > > > Makund - it is quite likely that your solution will break when > > multithreading arrives (as will will loads of other stuff) > > Could you explain why please, for the uninitiated? > Thanks > Colin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---