GithubHelp home page GithubHelp logo

tango-controls-hdbpp / hdbpp-es Goto Github PK

View Code? Open in Web Editor NEW
1.0 8.0 7.0 8.25 MB

Tango device server for the HDB++ Event Subscriber. Moved to https://gitlab.com/tango-controls/hdbpp/hdbpp-es

Home Page: http://www.tango-controls.org/community/projects/hdbplus

C++ 98.29% CMake 1.71%
hdbpp historical database tango-controls tango-controls-hdbpp device-server subscriber archiver

hdbpp-es's People

Contributors

bourtemb avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hdbpp-es's Issues

Context attribute event.

Ciao
It could be nice to have events (change and archive) when Context attribute change on ES devices.
We would like to store it in HDB++.
Thanks
Pascal

Archiving contexts/strategies

Hello.
Context based mechanism has a bit tangled description in the documentation.
Can someone explain it by simple example - I want to archive every event while ES running and start attribute archiving after the DS launched? (StartArchivingAtStartup was more obvious)

I've found 4 options, but I have no clue what they mean, except ALWAYS:

ALWAYS: always stored
RUN: stored during run
SHUTDOWN: stored during shutdown
SERVICE: stored during maintenance activities

Manage archiving dynamic attributes

In the case of dynamic attributes, it is possible that an attribute stopped being exported. In this case the archiver will report an error and try to reconnect till the attributes is back again.
Tango can generate INTERFACE_CHANGE_EVENT that could be used to detect if an attribute is not exported anymore by a device, and so let us stop the archiving till it is back.
This would be really beneficial for dynamic attributes.

Link error with project-build (PushThread.cpp:(.text+0xc5): undefined reference to `getDBFactory')

[proc] Executing command: /usr/bin/cmake --build /home/fbggroup/tangoControlsProject/hdbpp_gitHub/hdbpp-es/build --config Debug --target all -- -j 6
[build] [ 0%] Linking CXX executable hdb++es-srv
[build] CMakeFiles/hdbpp_es.dir/src/PushThread.cpp.o: In function HdbEventSubscriber_ns::PushThreadShared::PushThreadShared(HdbEventSubscriber_ns::HdbDevice*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)': [build] PushThread.cpp:(.text+0xc5): undefined reference to getDBFactory'
[build] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[build] CMakeFiles/hdbpp_es.dir/build.make:259: recipe for target 'hdb++es-srv' failed
[build] make[2]: *** [hdb++es-srv] Error 1
[build] make[1]: *** [CMakeFiles/hdbpp_es.dir/all] Error 2
[build] make: *** [all] Error 2
[build] CMakeFiles/Makefile2:400: recipe for target 'CMakeFiles/hdbpp_es.dir/all' failed
[build] Makefile:170: recipe for target 'all' failed

hdbpp-es got Tango exception on ARM64

Please help.
I successfully compiled and ran the hdb++es-srv device server on an ARM64 running Ubuntu18.04.
But the device server failed in DServer:init_device.
With gdb debugger, I isolated to line 151 of HdbDevice.cpp

//	Create thread to send commands to HdbAccess device
push_shared = std::make_shared<PushThreadShared>(this,
		Tango::Util::instance()->get_ds_inst_name(),
		(static_cast<HdbEventSubscriber *>(_device))->libConfiguration);

Can you help point me to how to fix this problem?
Thanks,
Tac.

fbggroup@fbg-009:~/hdbpp-es/build$ ./hdb++es-srv 01 -v4
1598391039 [547709059088] DEBUG archiving/hdb++/eventsubscriber.01 HdbEventSubscriber::init_device() create device archiving/hdb++/eventsubscriber.01
1598391039 [547709059088] DEBUG archiving/hdb++/eventsubscriber.01 subscribeRetryPeriod = 60
1598391039 [547709059088] DEBUG archiving/hdb++/eventsubscriber.01 subscribeChangeAsFallback = 0
1598391039 [547709059088] INFO archiving/hdb++/eventsubscriber.01 HdbEventSubscriber id=0
1598391039 [547709059088] DEBUG archiving/hdb++/eventsubscriber.01 CONFIGURING CONTEXTS: adding ALWAYS <-> 0
1598391039 [547709059088] DEBUG archiving/hdb++/eventsubscriber.01 CONFIGURING CONTEXTS: adding SERVICE <-> 1
1598391039 [547709059088] DEBUG archiving/hdb++/eventsubscriber.01 CONFIGURING CONTEXTS: adding SHUTDOWN <-> 2
1598391039 [547709059088] DEBUG archiving/hdb++/eventsubscriber.01 CONFIGURING CONTEXTS: adding RUN <-> 3
1598391039 [547709059088] DEBUG archiving/hdb++/eventsubscriber.01 add_domain: found domain -> localhost:10000
1598391039 [547709059088] INFO archiving/hdb++/eventsubscriber.01 HdbDevice::get_hdb_signal_list: 0: tango://localhost:10000/sys/tg_test/1/ampli;strategy=ALWAYS;ttl=0
1598391039 [547709059088] DEBUG archiving/hdb++/eventsubscriber.01 add_domain: found domain in map -> localhost:10000
1598391039 [547709059088] INFO archiving/hdb++/eventsubscriber.01 HdbDevice::get_hdb_signal_list: 1: tango://localhost:10000/sys/tg_test/1/long_scalar;strategy=ALWAYS;ttl=0
1598391039 [547709059088] DEBUG archiving/hdb++/eventsubscriber.01 add_domain: found domain in map -> localhost:10000
1598391039 [547709059088] INFO archiving/hdb++/eventsubscriber.01 HdbDevice::get_hdb_signal_list: 2: tango://localhost:10000/sys/tg_test/1/double_scalar;strategy=ALWAYS;ttl=0
Tango exception
Severity = ERROR
Error reason = API_MemoryAllocation
Desc : Can't allocate memory in server while building command(s) or device(s) for class number 1
Origin : DServer::init_device

Received a CORBA_Exception
Exiting

Can't add attribute

Hello. When I try to add new attribute to the archiving list using Configurator app or by command in "Test Device", I see errors in log files.

Thu Jul 23 14:28:50 2020: Event tango://mpd-tof-sc-2.he.jinr.ru:10000/mpd/tof/hvsys_202_scalar/umes_14.idl5_archive not found in event callback map !!!
Thu Jul 23 14:29:02 2020: Event tango://mpd-tof-sc-2.he.jinr.ru:10000/mpd/tof/hvsys_202_scalar/umes_14.idl5_attr_conf not found in event callback map !!!
Tango exception
Severity = ERROR
Error reason = Consistency Error
Desc : Attempt to update the ttl for an attribute that does not exist. Attribute: tango://mpd-tof-sc-2.he.jinr.ru:10000/mpd/tof/hvsys_202_scalar/umes_14
Origin : HdbppTxUpdateTtl.hpp:store:100

Tango exception
Severity = ERROR
Error reason = Consistency Error
Desc : This attribute [tango://mpd-tof-sc-2.he.jinr.ru:10000/mpd/tof/hvsys_202_scalar/umes_14] does not exist in the database. Unable to work with this attribute until it is added.
Origin : DbConnection.cpp:fetchLastHistoryEvent:469

Tango exception
Severity = ERROR
Error reason = Consistency Error
Desc : This attribute [tango://mpd-tof-sc-2.he.jinr.ru:10000/mpd/tof/hvsys_202_scalar/umes_14] does not exist in the database. Unable to work with this attribute until it is added.
Origin : DbConnection.tpp:storeDataEvent:120

Tango exception
Severity = ERROR
Error reason = Consistency Error
Desc : This attribute [tango://mpd-tof-sc-2.he.jinr.ru:10000/mpd/tof/hvsys_202_scalar/umes_14] does not exist in the database. Unable to work with this attribute until it is added.
Origin : DbConnection.cpp:storeParameterEvent:301

Previously configured attributes, but deleted from ES, are added without errors again.

LibConfiguration property:

connect_string=user=hdb_event_sub password=hdbpp host=localhost port=5432 dbname=hdb
logging_level=error
log_file=false
log_console=false
libname=libhdb++timescale.so

PostgreSQL 11, TimescaleDB 1.6.0

Also I've recently updated hdbpp-cm, because there were problems with transactions from CM DS (picture from Zabbix). Can be connected?

image

Allow to call AttributeAdd without passing data_type, data_format, write_type

AttributeAdd takes five argin parameters: name, strategy, data_type, data_format, write_type.
The last three (data_type, data_format, write_type) are computed by ConfigurationManager using DeviceProxy::get_attribute_config, but in very simple setup, ConfigurationManager could not be present and these parameters needs to be computed "by hand".
I suggest moving the existing code from the ConfigurationManager to the EventSubscriber, so that AttributeAdd accept always 1 or 2 parameters: name and optionally strategy (otherwise defaultStrategy is used).
Alternatively AttributeAdd could compute data_type, data_format, write_type only if they are not passed, so that ConfigurationManager doesn't need to be modified.
I prefer the first solution, so that AttributeAdd could be called with just attribute name as parameter.

AttributeRemove freezes

When we remove an attribute from the eventsubscriber, we notice hdbppes-srv freezing up immediately (becoming unresponsive towards Tango), see the log below. The SharedData::put_signal_property function is entered, but is never exited.

I don't have access to debug symbols, making debugging hard, but by code inspection, it seems that perhaps in SharedData:

  • The veclock.writerIn() lock taken in remove at is never released (at function end and the thrown exception?)
  • Causing put_signal_property to freeze up once veclock.readerIn() is called.

hdbppes-srv debug log after calling es_proxy.attributeremove() from Python:

1649265497 [140699462772480] DEBUG archiving/hdbppts/eventsubscriber01 SharedData::remove: unsubscribing ARCHIVE_EVENT... tango://databaseds.tangonet:10000/stat/sdp/1/fpga_error_r
1649265497 [140699462772480] DEBUG dserver/hdbppes-srv/01 In get_monitor() unknown, thread = 11, ctr = 0
1649265497 [140699462772480] DEBUG dserver/hdbppes-srv/01 In rel_monitor() unknown, ctr = 1, thread = 11
1649265497 [140699462772480] DEBUG dserver/hdbppes-srv/01 Signalling !
1649265497 [140699462772480] DEBUG archiving/hdbppts/eventsubscriber01 SharedData::remove: unsubscribed ARCHIVE_EVENT... tango://databaseds.tangonet:10000/stat/sdp/1/fpga_error_r
1649265497 [140699462772480] DEBUG archiving/hdbppts/eventsubscriber01 SharedData::remove: unsubscribing ATTR_CONF_EVENT... tango://databaseds.tangonet:10000/stat/sdp/1/fpga_error_r
1649265497 [140699462772480] DEBUG dserver/hdbppes-srv/01 In get_monitor() unknown, thread = 11, ctr = 0
1649265497 [140699462772480] DEBUG dserver/hdbppes-srv/01 In rel_monitor() unknown, ctr = 1, thread = 11
1649265497 [140699462772480] DEBUG dserver/hdbppes-srv/01 Signalling !
1649265497 [140699462772480] DEBUG archiving/hdbppts/eventsubscriber01 SharedData::remove: unsubscribed ATTR_CONF_EVENT... tango://databaseds.tangonet:10000/stat/sdp/1/fpga_error_r
1649265497 [140699462772480] DEBUG archiving/hdbppts/eventsubscriber01 SharedData::remove: removing tango://databaseds.tangonet:10000/stat/sdp/1/fpga_error_r
1649265497 [140699462772480] DEBUG archiving/hdbppts/eventsubscriber01 SharedData::remove: stopped tango://databaseds.tangonet:10000/stat/sdp/1/fpga_error_r
1649265497 [140699462772480] DEBUG archiving/hdbppts/eventsubscriber01 SharedData::remove: removed tango://databaseds.tangonet:10000/stat/sdp/1/fpga_error_r
1649265497 [140699462772480] DEBUG archiving/hdbppts/eventsubscriber01 SubscribeThread::remove: going to increase action... action=0++
1649265497 [140699462772480] DEBUG dserver/hdbppes-srv/01 Leaving DeviceClass::command_handler() method
1649265497 [140699462772480] DEBUG dserver/hdbppes-srv/01 SubDevDiag::set_associated_device() entering ...
1649265497 [140699462772480] DEBUG archiving/hdbppts/eventsubscriber01 SharedData::remove: stopped tango://databaseds.tangonet:10000/stat/sdp/1/fpga_error_r
1649265497 [140699462772480] DEBUG archiving/hdbppts/eventsubscriber01 SharedData::remove: removed tango://databaseds.tangonet:10000/stat/sdp/1/fpga_error_r
1649265497 [140699462772480] DEBUG archiving/hdbppts/eventsubscriber01 SubscribeThread::remove: going to increase action... action=0++
1649265497 [140699462772480] DEBUG dserver/hdbppes-srv/01 Leaving DeviceClass::command_handler() method
1649265497 [140699462772480] DEBUG dserver/hdbppes-srv/01 SubDevDiag::set_associated_device() entering ...
1649265497 [140699462772480] DEBUG dserver/hdbppes-srv/01 DeviceImpl::command_inout(): leaving method for command attributeremove
1649265497 [140699462772480] DEBUG dserver/hdbppes-srv/01 In rel_monitor() archiving/hdbppts/eventsubscriber01, ctr = 2, thread = 11
1649265497 [140699462772480] DEBUG dserver/hdbppes-srv/01 In rel_monitor() archiving/hdbppts/eventsubscriber01, ctr = 1, thread = 11
1649265497 [140699462772480] DEBUG dserver/hdbppes-srv/01 Signalling !
1649265497 [140699479557888] DEBUG archiving/hdbppts/eventsubscriber01 run_undetached: AWAKE
1649265497 [140699479557888] DEBUG archiving/hdbppts/eventsubscriber01 SharedData::put_signal_property: put_signal_property entering action=1

Use NAME_SRV during install

Despite the existence of NAME_SRV variable, it is not used during install. Name of Device Server is hardcoded

Gitlab Migration: Please log into GL with your GH account ASAP

Dear hdbpp-es contributor (via commits, comments on issue or pull requests, issue creator),
If you have contributed in any way (commit, issue or Pull Request creation or comment) to hdbpp-es, please log into Gitlab.com using your Github account ASAP.
See https://gitlab.com/tango-controls/TangoTickets/-/issues/47 for details.
Please click on the following link and add your github account name to this framapad when you've already done the login to Gitlab.com using your Github account:
https://mensuel.framapad.org/p/migration_ready_2548763689
Please note that login on gitlab.com using your Github account is safe and doesn't give your Github password to Gitlab.
For convenience, here is the list of contributors we could already find (and who did not signal they had done it yet for another repo):

Thank you for your cooperation.

Strange TTL

Hello.

I've noticed strange TTL values during the tests when I add attributes to ES.
Attr conf dialog:
image
Started attributes table:
image
Property in Jive:
image
ttl=0 in cases when I edited it by myself.

Executing AttributeAdd command from "Test Device" has the same result.
image

HDB libs and servers are forked, edited (#10 (comment)) and can be found in my profile.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.