search for: abort_on_except

Displaying 12 results from an estimated 12 matches for "abort_on_except".

2007 Dec 19
6
thread_pooling sleeping
I''m trying to run a single worker that could perform a periodic task for a given user. >From a controller, I imagine something like: def start_job MiddleMan.ask_work(:worker => :foo_worker, :worker_method => :perform_task, :data => { :user_id = current_user.id }) end def check_job @status = MiddleMan.ask_status(:worker => :foo_worker)[current_user.id] end
2006 Oct 01
11
Mongrel woes fixed
....rb. I am not sure if this is really the correct way to handle this issue though. As some famous programmers have been known to say "select() ain''t broken" so I''m not really sure what to think of this. The second problem stems from the fact that Mongrel uses the Thread#abort_on_exception. I''m not sure why this is even in there, as the documentation says: When set to true, causes all threads (including the main program) to abort if an exception is raised in thr. The process will effectively exit(0). The patch simply removes the abort_on_exceptio...
2006 Aug 03
2
thread problems
I have a really long series of queries (import from other database*) that takes about 2 or 3 minutes. I wanted to spawn a thread and put the job there, but there seems to be some problems with active record and threads: (this is what I found after googling) Thread.abort_on_exception = true => true 100.times do Thread.new do Client.find(:first) end end this throws an exception... So the question here: Is someone working on this? if the answer is no, I will give it a try, because I really need threads to be working on my app. If the answer is yes, who is working...
2008 Jun 12
4
Background thread - entension code - switch contexts
...super(nil,-1,"Title") set_client_size(Wx::Size.new(300,300)) panel = Wx::Panel.new(self) sizer = Wx::BoxSizer.new(Wx::VERTICAL) btn = Wx::Button.new(panel, -1, "Click me") sizer.add(btn, 0, Wx::GROW|Wx::ALL,2) evt_button(btn.get_id){ Thread.abort_on_exception = true #that does not work @th = Thread.new do Wx::Timer.every(20) do Thread.pass end method1 end } panel.set_sizer(sizer) sizer.fit(panel) end def method1 alg = Cppapp::Algorithm.new alg.form = Cppapp::F...
2006 Jun 18
0
Thread safety in activerecord(?), connection lost to mysql server - simple code sample provided
...undrb worker that each do things with activerecord models. I get the connection lost to mysql server exception about 90% of the time, with my process working by sheer luck the other 10%. I''ve broken down the problem to the following example that I just ran in the console: >> Thread.abort_on_exception = true => true >> 100.times do ?> Thread.new do ?> Client.find(:first) >> end >> end /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract_adapter.rb:120:in `log'': Mysql::Error: Lost connection to MySQL se...
2008 Jan 16
2
Question about WxNotebook, threads, and GUI refreshing
I''m running into a problem I''ve had before with wxRuby where the GUI does not update while my App is processing some set of data. The fix for this I know is to put the data processing piece in a new thread and in the Wx::App code make a timer to pass the threads. This has always worked in the past, but now my problem is slightly more complex and I''m at a loss.
2008 May 29
7
how to write spec for infinite loop?
Hi, I''ve got trouble when describe infinite loop. code snippet: def start_loop while true data = self.server.handle_client if data self.manager.dispatch(data) end end end without the loop, it is easy to test the logic. but how can I describe it to tell the developer ( me :-) ) that there should be an infinite loop inside. thanks. Regards, Peng
2009 May 15
0
[PATCH server] Starting of new ovirt QMF API.
...esponse(context, 1, "ERROR: #{ex}", args) + end + end + + + def ensure_credentials() + get_credentials('qpidd') + + Thread.new do + while true do + sleep(3600) + get_credentials('qpidd') + end + end + end + + def mainloop + Thread.abort_on_exception = true + + @agent.set_connection(@connection) + + @ovirt_model.start + + sleep + end +end + + +ovirt_agent = OvirtAgent.new +ovirt_agent.mainloop + + diff --git a/src/ovirt-agent/ovirt-test.rb b/src/ovirt-agent/ovirt-test.rb new file mode 100755 index 0000000..d97416b --- /dev/null +++...
2006 Nov 04
19
Mongrel 0.3.13.4 Pre-Release -- Ruby''s LEAK Fixed (Death To Mutex!)
Howdy Folks, This release is after painstaking analysis of a memory leak that was reported by Bradley Taylor, reduced by myself, and then fixed after much work. You should all thank Bradley for finding the bizarre fix. It turns out the Ruby has a memory leak when you use pretty much any thread locking primitive other than Sync (Mutex, Monitor, etc.): http://pastie.caboo.se/10194 The fix (for
2005 Aug 25
1
newbie questions about hosting address
...ions.rb:621:in `src_entity='' As you can see, it expects a class of type "Entity", and it has a class of type "Entity" - so I don''t know what the problem is. Again, this only occurs when I spawn a new thread like so: indexer = EntityIndexer.new(entity) Thread.abort_on_exception = true Thread.new(indexer) do | entity_indexer | entity_indexer.index end The "entity" argument that''s passed into the new is what''s available in the above code snippet as "@entity". def initialize(entity) @entity = entity end Can anybody point me in the...
2009 Nov 04
4
[PATCH server] Update daemons to use new QMF.
...ing time delta for agent #{agent.key} - #{delta}" if delta > 30 # No heartbeat for 30 seconds.. deal with dead/disconnected agent. @@ -545,15 +537,10 @@ class DbOmatic < Qpid::Qmf::Console end end - def main() - + Thread.abort_on_exception = true dbsync = DbOmatic.new() - - # Call into mainloop.. dbsync.check_heartbeats() - end main() - diff --git a/src/host-browser/host-register.rb b/src/host-browser/host-register.rb index 06d8553..e57b077 100755 --- a/src/host-browser/host-register.rb +++ b/src/host-browser/host...
2006 Oct 25
14
[SEC] Mongrel Temporary Fix For cgi.rb 99% CPU DoS Attack
This is important so please read this message very carefully. There is a DoS for Ruby''s cgi.rb that is easily exploitable. The attack involves sending a malformed multipart MIME body in an HTTP request. The full explanation of the attack as well as how to fix it RIGHT NOW is given below. Most of the work was done by Jeremy Kemper and Jamis Buck. They did all the work of building the