eventmachine-le 1.1.5 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  EventMachine-LE (Live Edition) is a branch of [EventMachine](http://github.com/eventmachine/eventmachine) with fixes and more features.
4
4
 
5
- * Home page: http://ibc.github.com/EventMachine-LE/
5
+ [![Build Status](https://travis-ci.org/ibc/EventMachine-LE.png?branch=master)](https://travis-ci.org/ibc/EventMachine-LE)
6
6
 
7
7
 
8
8
  ## What do you mean by "branch"? ##
@@ -49,6 +49,11 @@ for EventMachine, just with additional (and fixed) functionality.
49
49
  The list of additions and improvements will grow over time. Currently the following features/fixes have been applied in EventMachine-LE:
50
50
 
51
51
 
52
+ ### Version 1.1.6
53
+
54
+ * Avoid CPU at 100% when calling `close_connection` after a connection has been `unbind`: [ept](https://github.com/ibc/EventMachine-LE/pull/18).
55
+
56
+
52
57
  ### Version 1.1.5
53
58
 
54
59
  * Fix bug when the system time is changed to earlier time (which made EM to eat up the CPU cycle): [commit in EM](https://github.com/eventmachine/eventmachine/commit/1427a2c80c401d841194132a9af15baefd68b5ae).
@@ -280,6 +280,7 @@ evma_num_close_scheduled
280
280
 
281
281
  extern "C" int evma_num_close_scheduled ()
282
282
  {
283
+ ensure_eventmachine("evma_num_close_scheduled");
283
284
  return EventMachine->NumCloseScheduled;
284
285
  }
285
286
 
data/ext/ed.cpp CHANGED
@@ -220,6 +220,8 @@ EventableDescriptor::ScheduleClose
220
220
 
221
221
  void EventableDescriptor::ScheduleClose (bool after_writing)
222
222
  {
223
+ if (IsCloseScheduled())
224
+ return;
223
225
  MyEventMachine->NumCloseScheduled++;
224
226
  // KEEP THIS SYNCHRONIZED WITH ::IsCloseScheduled.
225
227
  if (after_writing)
@@ -1,4 +1,4 @@
1
1
  module EventMachine
2
- VERSION = "1.1.5"
2
+ VERSION = "1.1.6"
3
3
  end
4
4
 
@@ -30,4 +30,24 @@ class TestConnectionCount < Test::Unit::TestCase
30
30
  assert_equal(1, $server_conns)
31
31
  assert_equal(4, $client_conns + $server_conns)
32
32
  end
33
- end
33
+
34
+ module DoubleCloseClient
35
+ def unbind
36
+ close_connection
37
+ $num_close_scheduled_1 = EM.num_close_scheduled
38
+ EM.next_tick do
39
+ $num_close_scheduled_2 = EM.num_close_scheduled
40
+ EM.stop
41
+ end
42
+ end
43
+ end
44
+
45
+ def test_num_close_scheduled
46
+ EM.run {
47
+ assert_equal(0, EM.num_close_scheduled)
48
+ EM.connect("127.0.0.1", 9999, DoubleCloseClient) # nothing listening on 9999
49
+ }
50
+ assert_equal(1, $num_close_scheduled_1)
51
+ assert_equal(0, $num_close_scheduled_2)
52
+ end
53
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventmachine-le
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-04-02 00:00:00.000000000 Z
14
+ date: 2013-10-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake-compiler