Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing CI #700

Merged
merged 27 commits into from May 23, 2018
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e469e6b
Remove actor test exclusion on JRuby
pitr-ch Mar 2, 2018
cb1a0a6
Scope THREADS constant
pitr-ch Mar 2, 2018
e276148
Require support files directly
pitr-ch Mar 2, 2018
0ac25cb
Remove trailing spaces
pitr-ch Mar 2, 2018
82cae34
Do not reset global threads
pitr-ch Mar 2, 2018
4e63aec
Fix uninitialized instance variable warning
pitr-ch Mar 4, 2018
151c4b0
Update build tools
pitr-ch May 7, 2018
744ded7
Remove redundant import
pitr-ch May 11, 2018
c4fb0bd
Log when message arrives and when it's processed by actor
pitr-ch May 11, 2018
8ec8a32
Formatting
pitr-ch May 11, 2018
c8564b6
Ensure all threads in tests terminate
pitr-ch May 17, 2018
261832d
Fix some warnings during rspec tests
pitr-ch May 17, 2018
401b3de
rename to avoid IDE confusion
pitr-ch May 17, 2018
366d6aa
Unify rspec tags
pitr-ch May 17, 2018
8614384
remove trailing spaces
pitr-ch May 17, 2018
1e51d2c
Rollback using Java Exchanger and CountDownLatch implementations
pitr-ch May 17, 2018
23cb3f9
make sure sentinel values are ::Objects
pitr-ch May 17, 2018
a6fc08f
Rollback java executor implementation
pitr-ch May 17, 2018
e14ccb3
Reduce output pollution by warnings
pitr-ch May 18, 2018
ab5cdf2
Do not call subject/let defined methods in after block when the threa…
pitr-ch May 18, 2018
c2e8c31
Do not use timeout
pitr-ch May 18, 2018
06634ef
remove dead code
pitr-ch May 19, 2018
0f49c5e
stabilize tests
pitr-ch May 19, 2018
0d55fa3
If write lock is not held do not change the counter
pitr-ch May 19, 2018
e92b323
Do not use keywords
pitr-ch May 20, 2018
7bab699
fix documentation
pitr-ch May 22, 2018
fcd5886
Stabilize
pitr-ch May 23, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions Gemfile
Expand Up @@ -6,13 +6,14 @@ gem 'concurrent-ruby-ext', path: '.', platform: :mri

group :development do
gem 'rake', '~> 11.0'
gem 'rake-compiler', '~> 0.9.5'
gem 'rake-compiler-dock', '~> 0.4.3'
gem 'rake-compiler', '~> 1.0.0'
gem 'rake-compiler-dock', '~> 0.6.0'
gem 'gem-compiler', '~> 0.3.0'
gem 'benchmark-ips', '~> 2.7'

# documentation
gem 'countloc', '~> 0.4.0', :platforms => :mri, :require => false
# TODO (pitr-ch 04-May-2018): update to remove: [DEPRECATION] `last_comment` is deprecated. Please use `last_description` instead.
gem 'yard', '~> 0.8.0', :require => false
gem 'redcarpet', '~> 3.3', platforms: :mri # understands github markdown
gem 'md-ruby-eval'
Expand Down
4 changes: 1 addition & 3 deletions Rakefile
Expand Up @@ -181,9 +181,7 @@ begin
--backtrace
--seed 1
--format documentation
--tag ~unfinished
--tag ~notravis
--tag ~buggy ]
--tag ~notravis ]

RSpec::Core::RakeTask.new(:travis) do |t|
t.rspec_opts = ['--color', *options].join(' ')
Expand Down
1 change: 0 additions & 1 deletion ext/ConcurrentRubyExtService.java
Expand Up @@ -2,7 +2,6 @@

import org.jruby.Ruby;
import org.jruby.runtime.load.BasicLibraryService;
import com.concurrent_ruby.ext.JRubyMapBackendLibrary;

public class ConcurrentRubyExtService implements BasicLibraryService {
public boolean basicLoad(final Ruby runtime) throws IOException {
Expand Down
10 changes: 7 additions & 3 deletions lib/concurrent/actor.rb
Expand Up @@ -35,9 +35,13 @@ def self.current
end

@root = Concurrent::Promises.delay do
Core.new(parent: nil, name: '/', class: Root, initialized: future = Concurrent::Promises.resolvable_future).reference.tap do
future.wait!
end
Core.
new(parent: nil,
name: '/',
class: Root,
initialized: future = Concurrent::Promises.resolvable_future).
reference.
tap { future.wait! }
end

# A root actor, a default parent of all actors spawned outside an actor
Expand Down
3 changes: 2 additions & 1 deletion lib/concurrent/actor/core.rb
Expand Up @@ -90,8 +90,9 @@ def remove_child(child)
# can be called from other alternative Reference implementations
# @param [Envelope] envelope
def on_envelope(envelope)
log(DEBUG) { "is #{envelope.future ? 'asked' : 'told'} #{envelope.message.inspect} by #{envelope.sender}" }
schedule_execution do
log(DEBUG) { "was #{envelope.future ? 'asked' : 'told'} #{envelope.message.inspect} by #{envelope.sender}" }
log(DEBUG) { "was #{envelope.future ? 'asked' : 'told'} #{envelope.message.inspect} by #{envelope.sender} - processing" }
process_envelope envelope
end
nil
Expand Down
2 changes: 1 addition & 1 deletion lib/concurrent/atomic/count_down_latch.rb
Expand Up @@ -55,7 +55,7 @@ module Concurrent
# @!macro internal_implementation_note
CountDownLatchImplementation = case
when Concurrent.on_jruby?
JavaCountDownLatch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, could we get some details on why the 'native' JRuby stuff, seems to be going away?
understand the limited time for maintenance but still seems weird these had to go ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, please have a look at #717. I am updating the changelog before release, and when the 1.0.6.pre goes out it will mention this as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ask any follow up questions there.

MutexCountDownLatch
else
MutexCountDownLatch
end
Expand Down
7 changes: 6 additions & 1 deletion lib/concurrent/concern/logging.rb
Expand Up @@ -17,7 +17,12 @@ module Logging
def log(level, progname, message = nil, &block)
#NOTE: Cannot require 'concurrent/configuration' above due to circular references.
# Assume that the gem has been initialized if we've gotten this far.
(@logger || Concurrent.global_logger).call level, progname, message, &block
logger = if defined?(@logger) && @logger
@logger
else
Concurrent.global_logger
end
logger.call level, progname, message, &block
rescue => error
$stderr.puts "`Concurrent.configuration.logger` failed to log #{[level, progname, message, block]}\n" +
"#{error.message} (#{error.class})\n#{error.backtrace.join "\n"}"
Expand Down
2 changes: 1 addition & 1 deletion lib/concurrent/exchanger.rb
Expand Up @@ -329,7 +329,7 @@ def do_exchange(value, timeout)
# @!macro internal_implementation_note
ExchangerImplementation = case
when Concurrent.on_jruby?
JavaExchanger
RubyExchanger
else
RubyExchanger
end
Expand Down
5 changes: 2 additions & 3 deletions lib/concurrent/ivar.rb
Expand Up @@ -157,9 +157,8 @@ def ns_initialize(value, opts)
self.observers = Collection::CopyOnWriteObserverSet.new
set_deref_options(opts)

if value == NULL
@state = :pending
else
@state = :pending
if value != NULL
ns_complete_without_notification(true, value, nil)
end
end
Expand Down
4 changes: 3 additions & 1 deletion lib/concurrent/synchronization/abstract_struct.rb
Expand Up @@ -138,13 +138,15 @@ def ns_initialize(*values)
end
unless name.nil?
begin
parent.send :remove_const, name if parent.const_defined? name
parent.const_set(name, clazz)
parent.const_get(name)
clazz
rescue NameError
raise NameError.new("identifier #{name} needs to be constant")
end
end
members.each_with_index do |member, index|
clazz.send :remove_method, member if clazz.method_defined? member
clazz.send(:define_method, member) do
@values[index]
end
Expand Down
1 change: 1 addition & 0 deletions lib/concurrent/timer_task.rb
Expand Up @@ -189,6 +189,7 @@ class TimerTask < RubyExecutorService
def initialize(opts = {}, &task)
raise ArgumentError.new('no block given') unless block_given?
super
set_deref_options opts
end

# Is the executor running?
Expand Down
10 changes: 5 additions & 5 deletions spec/concurrent/actor_spec.rb
Expand Up @@ -6,7 +6,7 @@ module Actor

# FIXME better tests!

RSpec.describe 'Concurrent::Actor', edge: true, if: !defined?(JRUBY_VERSION) do
RSpec.describe 'Concurrent::Actor', edge: true do

def terminate_actors(*actors)
actors.each do |actor|
Expand Down Expand Up @@ -148,7 +148,7 @@ def on_message(message)
end
end

it 'terminates with all its children', buggy: true do
it 'terminates with all its children', notravis: true do
child = subject.ask! :child
expect(subject.ask!(:terminated?)).to be_falsey
subject.ask(:terminate!).wait
Expand All @@ -172,7 +172,7 @@ def on_message(message)
describe 'message redirecting' do
let(:parent) do
AdHoc.spawn!(:parent) do
child = AdHoc.spawn!(:child) { -> m { m+1 } }
child = AdHoc.spawn!(:child) { -> m { m + 1 } }
-> message do
if message == :child
child
Expand Down Expand Up @@ -287,7 +287,7 @@ def on_message(message)
test = AdHoc.spawn! name: :tester, behaviour_definition: resuming_behaviour do

actor = AdHoc.spawn! name: :pausing,
behaviour_definition: Behaviour.restarting_behaviour_definition do
behaviour_definition: Behaviour.restarting_behaviour_definition do
queue << :init
-> m { m == :add ? 1 : pass }
end
Expand All @@ -313,7 +313,7 @@ def on_message(message)
end

describe 'pool' do
it 'supports asks', buggy: true do
it 'supports asks', notravis: true do
children = Queue.new
pool = Concurrent::Actor::Utils::Pool.spawn! 'pool', 5 do |index|
worker = Concurrent::Actor::Utils::AdHoc.spawn! name: "worker-#{index}", supervised: true do
Expand Down