From: Alex Young Date: 2006-12-08T16:12:30+09:00 Subject: Re: NoMethodError in protocol.rb Eric Hodel wrote: > On Dec 7, 2006, at 02:13 , Alex Young wrote: > >> Does this look familiar to anyone? >> >> NoMethodError: undefined method `+' for nil:NilClass at >> /usr/local/lib/ruby/1.8/net/protocol.rb:176:in `write0' >> def writing >> @written_bytes = 0 >> @debug_output << '<- ' if @debug_output >> yield >> @debug_output << "\n" if @debug_output >> bytes = @written_bytes >> @written_bytes = nil > > Yes, this is going to be a problem in a multithreaded environment. > >> bytes >> end >> >> Is this a known thread-safety issue with a known solution, or would a >> patch be in order? I've been testing this on 1.8.4, because that's >> what we've got in production. > > I've not heard of it before. > >> Does anyone know if it's been addressed in 1.8.5? > > Doubtful. > I've found a workaround for our code, anyway. I'm not quite sure why I was surprised that the HTTP library isn't thread-safe :-) Thanks, -- Alex