[jira] [Commented] (PROTON-1073) Building tests for C++ bindings seems to be broken on OSX 10.11/Xcode 7.1.1
[ https://issues.apache.org/jira/browse/PROTON-1073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15169588#comment-15169588 ] Ollivier Robert commented on PROTON-1073: - I think it can be closed, I managed to compile 0.12.0 and got no errors. > Building tests for C++ bindings seems to be broken on OSX 10.11/Xcode 7.1.1 > --- > > Key: PROTON-1073 > URL: https://issues.apache.org/jira/browse/PROTON-1073 > Project: Qpid Proton > Issue Type: Bug > Components: cpp-binding >Affects Versions: 0.11.0 > Environment: MacOS X 10.11.1, XCode 7.1.1 > Compilation options: > env CFLAGS="-I/opt/local/include -m64" LDFLAGS="-m64 -L/opt/local/lib" cmake > .. -DCMAKE_INSTALL_PREFIX=/usr/local -DSYSINSTALL_BINDINGS=ON -DBUILD_PHP=OFF > -DBUILD_PERL=OFF -DBUILD_PYTHON=OFF -DCMAKE_OSX_ARCHITECTURES=x86_64 >Reporter: Ollivier Robert >Assignee: Cliff Jansen > Labels: build-failure > > Compiling 0.11 leads to build failure in the tests for the C++ bindings: > [...] > Linking CXX shared library libqpid-proton-cpp.dylib > [ 66%] Built target qpid-proton-cpp > Scanning dependencies of target conversion_test > [ 66%] Building CXX object > proton-c/bindings/cpp/CMakeFiles/conversion_test.dir/src/conversion_test.cpp.o > /Users/roberto/Src/ERC/GIT/qpid-proton-0.11.0/proton-c/bindings/cpp/src/conversion_test.cpp:36:17: > error: > no viable constructor copying variable of type > 'std::unique_ptr' > session_ptr p = s.ptr(); > ^ ~~~ > /Users/roberto/Src/ERC/GIT/qpid-proton-0.11.0/proton-c/bindings/cpp/src/conversion_test.cpp:58:25: > note: > in instantiation of function template specialization > 'test_owning std::__1::default_delete >, > std::__1::unique_ptr std::__1::default_delete > >' > requested here > failed += run_test(&test_owning< > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:2497:5: > note: > candidate constructor not viable: expects an l-value for 1st argument > unique_ptr(unique_ptr&); > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:2499:9: > note: > candidate constructor [with _Up = proton::session, _Ep = > std::__1::default_delete] not viable: expects an > l-value for 1st > argument > unique_ptr(unique_ptr<_Up, _Ep>&); > ^ > /Users/roberto/Src/ERC/GIT/qpid-proton-0.11.0/proton-c/bindings/cpp/src/conversion_test.cpp:37:17: > error: > no viable constructor copying variable of type > 'std::unique_ptr' > session_ptr p2 = s.ptr(); > ^~~~ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:2497:5: > note: > candidate constructor not viable: expects an l-value for 1st argument > unique_ptr(unique_ptr&); > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:2499:9: > note: > candidate constructor [with _Up = proton::session, _Ep = > std::__1::default_delete] not viable: expects an > l-value for 1st > argument > unique_ptr(unique_ptr<_Up, _Ep>&); > ^ > 2 errors generated. > make[2]: *** > [proton-c/bindings/cpp/CMakeFiles/conversion_test.dir/src/conversion_test.cpp.o] > Error 1 > make[1]: *** [proton-c/bindings/cpp/CMakeFiles/conversion_test.dir/all] Error > 2 > make: *** [all] Error 2 -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (PROTON-1138) Assorted C++ API cleanups
[ https://issues.apache.org/jira/browse/PROTON-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15169197#comment-15169197 ] ASF subversion and git services commented on PROTON-1138: - Commit cd58e7774a8612ce70fe5f5f55dc9dfb15254723 in qpid-proton's branch refs/heads/master from [~aconway] [ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=cd58e77 ] PROTON-1138: C++ address review comments https://reviews.apache.org/r/43742/#review120777 > Assorted C++ API cleanups > - > > Key: PROTON-1138 > URL: https://issues.apache.org/jira/browse/PROTON-1138 > Project: Qpid Proton > Issue Type: Improvement > Components: cpp-binding >Affects Versions: 0.13.0 >Reporter: Justin Ross >Assignee: Justin Ross > Fix For: 0.13.0 > > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
Re: Proton-J Reactor sending delay
On 26. 02. 16 15.36, Bozo Dragojevic wrote: > Iiuc, calling anything except wakeup from outside the reactor thread is > forbidden. > > Reactor (whole proton-c and proton-j) has no locks to protect against > such use. > > The general pattern is to trigger your application from a handler for > 'on reactor init' and > add that handler to the reactor before starting it. > > To send messages from another thread, one needs to build that > functionality around proton. -- maybe it would make sense to add one > lock to quark to allow reactor.schedule() to be called from another s/quark/proton/ Context switch error :) > thread, that would simplify things a lot. > > Right now, I /think/ you cannot do it without a threadsafe queue, > producer needs to call reactor.wakeup() and consumer of the queue can be > a handler on the quiesced event and polls the queue (must not block). > > Bozzo > > > > On 25. 02. 16 20.03, Ken Giusti wrote: >> Andrew - are you calling send() from within a reactor callback? Or from >> another thread? >> >> I'm not very familiar with the Java reactor, but the C reactor has a method >> called pn_reactor_wakeup() which causes it to immediately return from the >> blocking select() call. >> >> -K >> >> - Original Message - >>> From: "Andrew Buckley" >>> To: d...@qpid.apache.org, proton@qpid.apache.org >>> Sent: Thursday, February 25, 2016 12:45:04 PM >>> Subject: RE: Proton-J Reactor sending delay >>> >>> Ah, thanks Robbie. Yes I do now notice the 3141ms timeout inside run(). Are >>> there plans to make that timeout configurable? At least from my point of >>> view, 3 seconds is quite a long time to wait between calling send and the >>> action actually being performed, and applications using the Reactor do >>> suffer a bit of a blow in performance because of this. >>> >>> Thanks, >>> -Andrew >>> >>> -Original Message- >>> From: Robbie Gemmell [mailto:robbie.gemm...@gmail.com] >>> Sent: Monday, February 15, 2016 3:47 AM >>> To: d...@qpid.apache.org; proton@qpid.apache.org >>> Subject: Re: Proton-J Reactor sending delay >>> >>> On 13 February 2016 at 00:28, Andrew Buckley wrote: I'm using the reactor with Proton-J and have noticed that there is a 2-4 second delay between when I call send() on a particular link and when that transfer frame actually goes out. Is this expected behavior? If so, are there plans to improve on this? And if not, have you seen this in any other scenario and might you have any ideas what could be causing it? Thanks, -Andrew Buckley >>> Hi Andrew, >>> >>> While im no expert on the reactor, I'd be surprised if that was expected, >>> and >>> I can't say I'm aware of it being mentioned before. >>> >>> One thing that springs to mind from previous discussion [about proton-c >>> reactor] is that when the reactor has a particular thread dedicated to >>> running it, it sets a 3141ms timeout on its selector meaning it wakes up at >>> that period when it is 'quiesced' (has nothing to do). Seems like perhaps >>> that could be related given your note of 2-4sec. >>> >>> Do you have an example showing the behaviour? >>> >>> Robbie >>> >>> (added proton@ as well, in case anyone only paying attention there has >>> thoughts) >>> >>> - >>> To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional >>> commands, e-mail: dev-h...@qpid.apache.org >>> >>>
Re: Proton-J Reactor sending delay
Iiuc, calling anything except wakeup from outside the reactor thread is forbidden. Reactor (whole proton-c and proton-j) has no locks to protect against such use. The general pattern is to trigger your application from a handler for 'on reactor init' and add that handler to the reactor before starting it. To send messages from another thread, one needs to build that functionality around proton. -- maybe it would make sense to add one lock to quark to allow reactor.schedule() to be called from another thread, that would simplify things a lot. Right now, I /think/ you cannot do it without a threadsafe queue, producer needs to call reactor.wakeup() and consumer of the queue can be a handler on the quiesced event and polls the queue (must not block). Bozzo On 25. 02. 16 20.03, Ken Giusti wrote: > Andrew - are you calling send() from within a reactor callback? Or from > another thread? > > I'm not very familiar with the Java reactor, but the C reactor has a method > called pn_reactor_wakeup() which causes it to immediately return from the > blocking select() call. > > -K > > - Original Message - >> From: "Andrew Buckley" >> To: d...@qpid.apache.org, proton@qpid.apache.org >> Sent: Thursday, February 25, 2016 12:45:04 PM >> Subject: RE: Proton-J Reactor sending delay >> >> Ah, thanks Robbie. Yes I do now notice the 3141ms timeout inside run(). Are >> there plans to make that timeout configurable? At least from my point of >> view, 3 seconds is quite a long time to wait between calling send and the >> action actually being performed, and applications using the Reactor do >> suffer a bit of a blow in performance because of this. >> >> Thanks, >> -Andrew >> >> -Original Message- >> From: Robbie Gemmell [mailto:robbie.gemm...@gmail.com] >> Sent: Monday, February 15, 2016 3:47 AM >> To: d...@qpid.apache.org; proton@qpid.apache.org >> Subject: Re: Proton-J Reactor sending delay >> >> On 13 February 2016 at 00:28, Andrew Buckley wrote: >>> I'm using the reactor with Proton-J and have noticed that there is a 2-4 >>> second delay between when I call send() on a particular link and when that >>> transfer frame actually goes out. Is this expected behavior? If so, are >>> there plans to improve on this? And if not, have you seen this in any >>> other scenario and might you have any ideas what could be causing it? >>> >>> Thanks, >>> -Andrew Buckley >>> >> Hi Andrew, >> >> While im no expert on the reactor, I'd be surprised if that was expected, and >> I can't say I'm aware of it being mentioned before. >> >> One thing that springs to mind from previous discussion [about proton-c >> reactor] is that when the reactor has a particular thread dedicated to >> running it, it sets a 3141ms timeout on its selector meaning it wakes up at >> that period when it is 'quiesced' (has nothing to do). Seems like perhaps >> that could be related given your note of 2-4sec. >> >> Do you have an example showing the behaviour? >> >> Robbie >> >> (added proton@ as well, in case anyone only paying attention there has >> thoughts) >> >> - >> To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional >> commands, e-mail: dev-h...@qpid.apache.org >> >>
Re: Proton-J Reactor sending delay
It looks to already be configurable, e.g. you could call the same method to update the value from the thread running the reactor, perhaps in the onReactorInit() handler. That said, I'm not sure youd would normally want to, except maybe to increase it, which is presumably not what you were thinking here when asking. My limited understanding of it is that the timeout should only really have an effect when the reactor thinks it has nothing else to do, with the value dictating how long the reactor awaits something new to do, e.g new data arriving to give it work, before it fires off another quiesced event. As such I would guess that in this case the reactor is either incorrect in thinking that it has nothing to do, or perhaps isn't being used in the intended/required fashion (see sub-thread from Ken's mail). Robbie On 25 February 2016 at 17:45, Andrew Buckley wrote: > Ah, thanks Robbie. Yes I do now notice the 3141ms timeout inside run(). Are > there plans to make that timeout configurable? At least from my point of > view, 3 seconds is quite a long time to wait between calling send and the > action actually being performed, and applications using the Reactor do suffer > a bit of a blow in performance because of this. > > Thanks, > -Andrew > > -Original Message- > From: Robbie Gemmell [mailto:robbie.gemm...@gmail.com] > Sent: Monday, February 15, 2016 3:47 AM > To: d...@qpid.apache.org; proton@qpid.apache.org > Subject: Re: Proton-J Reactor sending delay > > On 13 February 2016 at 00:28, Andrew Buckley wrote: >> I'm using the reactor with Proton-J and have noticed that there is a 2-4 >> second delay between when I call send() on a particular link and when that >> transfer frame actually goes out. Is this expected behavior? If so, are >> there plans to improve on this? And if not, have you seen this in any other >> scenario and might you have any ideas what could be causing it? >> >> Thanks, >> -Andrew Buckley >> > > Hi Andrew, > > While im no expert on the reactor, I'd be surprised if that was expected, and > I can't say I'm aware of it being mentioned before. > > One thing that springs to mind from previous discussion [about proton-c > reactor] is that when the reactor has a particular thread dedicated to > running it, it sets a 3141ms timeout on its selector meaning it wakes up at > that period when it is 'quiesced' (has nothing to do). Seems like perhaps > that could be related given your note of 2-4sec. > > Do you have an example showing the behaviour? > > Robbie > > (added proton@ as well, in case anyone only paying attention there has > thoughts) > > - > To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional > commands, e-mail: dev-h...@qpid.apache.org >
Re: Proton-J Reactor sending delay
Yes, where/when/how send is being called might be important, thats one reason why I asked for an example showing the behaviour. The java reactor does also has a wakeup method to prod the thread blocked in process() to life, which notes itself to be the only method you can call at the same time another thread is using the reactor. Robbie On 25 February 2016 at 19:03, Ken Giusti wrote: > > Andrew - are you calling send() from within a reactor callback? Or from > another thread? > > I'm not very familiar with the Java reactor, but the C reactor has a method > called pn_reactor_wakeup() which causes it to immediately return from the > blocking select() call. > > -K > > - Original Message - >> From: "Andrew Buckley" >> To: d...@qpid.apache.org, proton@qpid.apache.org >> Sent: Thursday, February 25, 2016 12:45:04 PM >> Subject: RE: Proton-J Reactor sending delay >> >> Ah, thanks Robbie. Yes I do now notice the 3141ms timeout inside run(). Are >> there plans to make that timeout configurable? At least from my point of >> view, 3 seconds is quite a long time to wait between calling send and the >> action actually being performed, and applications using the Reactor do >> suffer a bit of a blow in performance because of this. >> >> Thanks, >> -Andrew >> >> -Original Message- >> From: Robbie Gemmell [mailto:robbie.gemm...@gmail.com] >> Sent: Monday, February 15, 2016 3:47 AM >> To: d...@qpid.apache.org; proton@qpid.apache.org >> Subject: Re: Proton-J Reactor sending delay >> >> On 13 February 2016 at 00:28, Andrew Buckley wrote: >> > I'm using the reactor with Proton-J and have noticed that there is a 2-4 >> > second delay between when I call send() on a particular link and when that >> > transfer frame actually goes out. Is this expected behavior? If so, are >> > there plans to improve on this? And if not, have you seen this in any >> > other scenario and might you have any ideas what could be causing it? >> > >> > Thanks, >> > -Andrew Buckley >> > >> >> Hi Andrew, >> >> While im no expert on the reactor, I'd be surprised if that was expected, and >> I can't say I'm aware of it being mentioned before. >> >> One thing that springs to mind from previous discussion [about proton-c >> reactor] is that when the reactor has a particular thread dedicated to >> running it, it sets a 3141ms timeout on its selector meaning it wakes up at >> that period when it is 'quiesced' (has nothing to do). Seems like perhaps >> that could be related given your note of 2-4sec. >> >> Do you have an example showing the behaviour? >> >> Robbie >> >> (added proton@ as well, in case anyone only paying attention there has >> thoughts) >> >> - >> To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional >> commands, e-mail: dev-h...@qpid.apache.org >> >> > > -- > -K > > - > To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org > For additional commands, e-mail: dev-h...@qpid.apache.org >