[SCM] tango branch, master, updated. debian/8.0.5+dfsg-1-1-g1dd4c13

Picca Frédéric-Emma?==?UTF-8?Q?nuel picca at debian.org
Tue May 7 07:14:37 UTC 2013


The following commit has been merged in the master branch:
commit 503652604a4fd5d8fa3bf6c0011cd808eaec13bb
Author: Picca Frédéric-Emmanuel <picca at debian.org>
Date:   Sat Sep 15 22:15:30 2012 +0200

    import the upstream patch p805_1

diff --git a/debian/changelog b/debian/changelog
index 71f9b92..6048017 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ tango (8.0.5+dfsg-1) UNRELEASED; urgency=low
     - 0002-debian-my.cnf.in.patch (refreshed)
     - 0003-debian-notify_daemon.patch (refreshed)
     - 0004-upstream-fix-bug3285674.patch (deleted)
+    - 0004-upstream-fix-p805_1.patch (new)
     - 0005-upstream-fix-bug3213730.patch (deleted)
     - 0006-feature-forwarded-upstream-pkg-config-small-fixes.patch (deleted)
     - 0007-upstream-fix-tango-db-start-during-init.patch (deleted)
diff --git a/debian/patches/0004-upstream-fix-p805_1.patch b/debian/patches/0004-upstream-fix-p805_1.patch
new file mode 100644
index 0000000..279f9d4
--- /dev/null
+++ b/debian/patches/0004-upstream-fix-p805_1.patch
@@ -0,0 +1,470 @@
+From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= <picca at debian.org>
+Date: Sat, 15 Sep 2012 22:13:16 +0200
+Subject: upstream fix p805_1
+
+---
+ lib/cpp/client/dbapi_base.cpp  |   29 +++++----
+ lib/cpp/client/dbapi_datum.cpp |    5 ++
+ lib/cpp/client/proxy_asyn.cpp  |   51 ++++++++++-----
+ lib/cpp/server/dev_poll.cpp    |   39 +++++++-----
+ lib/cpp/server/dserver.cpp     |    1 +
+ lib/cpp/server/dserverpoll.cpp |  133 +++++++++++++++++++++-------------------
+ lib/cpp/server/eventcmds.cpp   |    4 +-
+ lib/cpp/server/pollobj.h       |   10 +--
+ 8 files changed, 161 insertions(+), 111 deletions(-)
+
+diff --git a/lib/cpp/client/dbapi_base.cpp b/lib/cpp/client/dbapi_base.cpp
+index 20fc8b7..e7baf64 100644
+--- a/lib/cpp/client/dbapi_base.cpp
++++ b/lib/cpp/client/dbapi_base.cpp
+@@ -733,7 +733,7 @@ string Database::get_info()
+ 	{
+ 		ostream << (*db_info_list)[i].in() << endl;
+ 	}
+-	ostream << ends;
++
+ 	string ret_str = ostream.str();
+ 
+ 	return(ret_str);
+@@ -3808,18 +3808,23 @@ DbDatum Database::get_services(string &servname,string &instname)
+ 	DbServerCache *dsc;
+ 	if (au->in_server() == true)
+ 	{
+-		try
+-		{
+-			Tango::Util *tg = Tango::Util::instance(false);
+-			dsc = tg->get_db_cache();
+-		}
+-		catch (Tango::DevFailed &e)
++		if (from_env_var == false)
++			dsc = NULL;
++		else
+ 		{
+-            string reason = e.errors[0].reason.in();
+-            if (reason == "API_UtilSingletonNotCreated" && ext->db_tg != NULL)
+-                dsc = ext->db_tg->get_db_cache();
+-            else
+-                dsc = NULL;
++			try
++			{
++				Tango::Util *tg = Tango::Util::instance(false);
++				dsc = tg->get_db_cache();
++			}
++			catch (Tango::DevFailed &e)
++			{
++				string reason = e.errors[0].reason.in();
++				if (reason == "API_UtilSingletonNotCreated" && ext->db_tg != NULL)
++					dsc = ext->db_tg->get_db_cache();
++				else
++					dsc = NULL;
++			}
+ 		}
+ 	}
+ 	else
+diff --git a/lib/cpp/client/dbapi_datum.cpp b/lib/cpp/client/dbapi_datum.cpp
+index 157d051..d85e2a0 100644
+--- a/lib/cpp/client/dbapi_datum.cpp
++++ b/lib/cpp/client/dbapi_datum.cpp
+@@ -77,6 +77,11 @@ DbDatum::DbDatum():ext(Tango_NullPtr)
+ 
+ DbDatum::~DbDatum()
+ {
++#ifndef HAS_UNIQUE_PTR
++	#ifndef _TG_WINDOWS_
++    delete ext;
++    #endif
++#endif
+ }
+ 
+ //-----------------------------------------------------------------------------
+diff --git a/lib/cpp/client/proxy_asyn.cpp b/lib/cpp/client/proxy_asyn.cpp
+index ac0356b..e9d9b5a 100644
+--- a/lib/cpp/client/proxy_asyn.cpp
++++ b/lib/cpp/client/proxy_asyn.cpp
+@@ -380,8 +380,8 @@ DeviceData Connection::command_inout_reply(long id)
+ 
+ //
+ // Check if the exception was a connection exception
+-// In this case, try to ping the device.
+-// If successfull, just returns otherwise, throw the first exception
++// If so, execute the command synchronously (tries to reconnect)
++// If successful just return, otherwise throw the first exception
+ //
+ 
+ 			string ex(cb_excep_mess);
+@@ -390,14 +390,6 @@ DeviceData Connection::command_inout_reply(long id)
+ 			{
+ 				try
+ 				{
+-					DeviceProxy *dev_ptr = static_cast<DeviceProxy *>(this);
+-					dev_ptr->ping();
+-
+-//
+-// If we arrive here, this means we have to do a re-try with a synchronous
+-// request
+-//
+-
+ 					DeviceData dd_out = redo_synch_cmd(req);
+ 
+ //
+@@ -502,15 +494,16 @@ DeviceData Connection::command_inout_reply(long id,long call_timeout)
+ 
+ 		for (i = 0;i < nb;i++)
+ 		{
++			if (req.request->poll_response() == true)
++			{
++				break;
++			}
++
+ #ifdef _TG_WINDOWS_
+ 			Sleep(20);
+ #else
+ 			nanosleep(&to_wait,&inter);
+ #endif
+-			if (req.request->poll_response() == true)
+-			{
+-				break;
+-			}
+ 		}
+ 
+ 		if (i == nb)
+@@ -626,7 +619,7 @@ DeviceData Connection::command_inout_reply(long id,long call_timeout)
+ 			set_connection_state(CONNECTION_NOTOK);
+ 
+ //
+-// Re-throw all CORBA system exceptions
++// Re-throw nearly all CORBA system exceptions
+ //
+ 
+ 			CORBA::NVList_ptr req_arg = req.request->arguments();
+@@ -637,6 +630,34 @@ DeviceData Connection::command_inout_reply(long id,long call_timeout)
+ 
+ 			char *cb_excep_mess = Tango::Except::print_CORBA_SystemException(sys_ex);
+ 
++//
++// Check if the exception was a connection exception
++// If so, execute the command synchronously (tries to reconnect)
++// If successful just return, otherwise throw the first exception
++//
++
++			string ex(cb_excep_mess);
++			string::size_type pos = ex.find("TRANSIENT_ConnectFailed");
++			if (pos != string::npos)
++			{
++				try
++				{
++					DeviceData dd_out = redo_synch_cmd(req);
++
++//
++// Remove request from request global table.
++//
++
++					CORBA::string_free(tmp);
++
++					remove_asyn_request(id);
++
++					return dd_out;
++
++				}
++				catch (Tango::DevFailed &) {}
++			}
++
+ 			TangoSys_OMemStream desc;
+ 			desc << "Failed to execute command_inout_asynch on device " << dev_name();
+ 			desc << ", command " << tmp << ends;
+diff --git a/lib/cpp/server/dev_poll.cpp b/lib/cpp/server/dev_poll.cpp
+index 4840e70..26c6aea 100644
+--- a/lib/cpp/server/dev_poll.cpp
++++ b/lib/cpp/server/dev_poll.cpp
+@@ -324,6 +324,13 @@ void DeviceImpl::poll_object(const string &obj_name,int period,PollObjType type)
+ {
+     Tango::Util *tg = Tango::Util::instance();
+ 
++	if (tg->is_svr_shutting_down() == true)
++	{
++		Except::throw_exception((const char *)"API_NotSupported",
++								(const char *)"It's not supported to start polling on any device cmd/attr while the device is shutting down",
++								(const char *)"DeviceImpl::poll_object");
++	}
++
+     if (tg->is_svr_starting() == true)
+     {
+ 
+@@ -550,30 +557,34 @@ void DeviceImpl::stop_poll_object(const string &obj_name,PollObjType type)
+     else
+     {
+ 
++		if (tg->is_device_restarting(device_name) == false)
++		{
++
+ //
+ // Ask the admin device to do the work (simulating the classical
+ // way to tune polling)
+ //
+ 
+-        DServer *ds = tg->get_dserver_device();
+-        CORBA::Any the_any;
++			DServer *ds = tg->get_dserver_device();
++			CORBA::Any the_any;
+ 
+-        DevVarStringArray *send = new DevVarStringArray();
+-        send->length(3);
++			DevVarStringArray *send = new DevVarStringArray();
++			send->length(3);
+ 
+-        (*send)[0] = CORBA::string_dup(get_name().c_str());
+-        if (type == POLL_CMD)
+-            (*send)[1] = CORBA::string_dup("command");
+-        else
+-            (*send)[1] = CORBA::string_dup("attribute");
+-        (*send)[2] = CORBA::string_dup(obj_name.c_str());
++			(*send)[0] = CORBA::string_dup(get_name().c_str());
++			if (type == POLL_CMD)
++				(*send)[1] = CORBA::string_dup("command");
++			else
++				(*send)[1] = CORBA::string_dup("attribute");
++			(*send)[2] = CORBA::string_dup(obj_name.c_str());
+ 
+-        the_any <<= send;
++			the_any <<= send;
+ 
+-        CORBA::Any *received_any;
++			CORBA::Any *received_any;
+ 
+-        received_any = ds->command_inout("RemObjPolling",the_any);
+-        delete received_any;
++			received_any = ds->command_inout("RemObjPolling",the_any);
++			delete received_any;
++		}
+     }
+ }
+ 
+diff --git a/lib/cpp/server/dserver.cpp b/lib/cpp/server/dserver.cpp
+index 9f8898c..698a7c9 100644
+--- a/lib/cpp/server/dserver.cpp
++++ b/lib/cpp/server/dserver.cpp
+@@ -940,6 +940,7 @@ void DServer::restart(string &d_name)
+ 	DeviceImpl *new_dev = NULL;
+ 
+ 	vector<Tango::DeviceImpl *> &d_list = dev_cl->get_device_list();
++
+ 	for (i = 0;i < d_list.size();i++)
+ 	{
+ 		if (d_list[i]->get_name() == lower_d_name)
+diff --git a/lib/cpp/server/dserverpoll.cpp b/lib/cpp/server/dserverpoll.cpp
+index 3d2caa1..dd5efa8 100644
+--- a/lib/cpp/server/dserverpoll.cpp
++++ b/lib/cpp/server/dserverpoll.cpp
+@@ -1338,97 +1338,102 @@ void DServer::rem_obj_polling(const Tango::DevVarStringArray *argin,bool with_db
+ //
+ 
+ 	PollingThreadInfo *th_info;
++	int poll_th_id;
+ 
+-	int poll_th_id = tg->get_polling_thread_id_by_name((*argin)[0]);
+-	if (poll_th_id == 0)
++	if (tg->is_svr_shutting_down() == false)
+ 	{
+-		TangoSys_OMemStream o;
+-		o << "Can't find a polling thread for device " << (*argin)[0] << ends;
+-		Except::throw_exception((const char *)"API_NotSupported",o.str(),
+-						(const char *)"DServer::rem_obj_polling");
+-	}
++		poll_th_id = tg->get_polling_thread_id_by_name((*argin)[0]);
++		if (poll_th_id == 0)
++		{
++			TangoSys_OMemStream o;
++			o << "Can't find a polling thread for device " << (*argin)[0] << ends;
++			Except::throw_exception((const char *)"API_NotSupported",o.str(),
++							(const char *)"DServer::rem_obj_polling");
++		}
+ 
+-	cout4 << "Thread in charge of device " << (*argin)[0] << " is thread " << poll_th_id << endl;
+-	th_info = tg->get_polling_thread_info_by_id(poll_th_id);
++		cout4 << "Thread in charge of device " << (*argin)[0] << " is thread " << poll_th_id << endl;
++		th_info = tg->get_polling_thread_info_by_id(poll_th_id);
+ 
+ //
+ // Test whether the polling thread is still running!
+ //
+ 
+-	if ( th_info->poll_th != NULL )
+-	{
++		if ( th_info->poll_th != NULL )
++		{
++
+ //
+ // Send command to the polling thread
+ //
+ 
+-		cout4 << "Sending cmd to polling thread" << endl;
+-		TangoMonitor &mon = th_info->poll_mon;
+-		PollThCmd &shared_cmd = th_info->shared_data;
++			cout4 << "Sending cmd to polling thread" << endl;
++			TangoMonitor &mon = th_info->poll_mon;
++			PollThCmd &shared_cmd = th_info->shared_data;
+ 
+-        int th_id = omni_thread::self()->id();
+-        if (th_id != poll_th_id)
+-		{
+-			omni_mutex_lock sync(mon);
+-			if (shared_cmd.cmd_pending == true)
++			int th_id = omni_thread::self()->id();
++			if (th_id != poll_th_id)
+ 			{
+-				mon.wait();
+-			}
+-			shared_cmd.cmd_pending = true;
+-			if (tmp_upd == 0)
+-				shared_cmd.cmd_code = POLL_REM_EXT_TRIG_OBJ;
+-			else
+-				shared_cmd.cmd_code = POLL_REM_OBJ;
+-			shared_cmd.dev = dev;
+-			shared_cmd.name = obj_name;
+-			shared_cmd.type = type;
++				omni_mutex_lock sync(mon);
++				if (shared_cmd.cmd_pending == true)
++				{
++					mon.wait();
++				}
++				shared_cmd.cmd_pending = true;
++				if (tmp_upd == 0)
++					shared_cmd.cmd_code = POLL_REM_EXT_TRIG_OBJ;
++				else
++					shared_cmd.cmd_code = POLL_REM_OBJ;
++				shared_cmd.dev = dev;
++				shared_cmd.name = obj_name;
++				shared_cmd.type = type;
+ 
+-			mon.signal();
++				mon.signal();
+ 
+-			cout4 << "Cmd sent to polling thread" << endl;
++				cout4 << "Cmd sent to polling thread" << endl;
+ 
+ //
+ // Wait for thread to execute command except if the command is
+ // requested by the polling thread itself
+ //
+ 
+-			int th_id = omni_thread::self()->id();
+-			if (th_id != poll_th_id)
+-			{
+-				while (shared_cmd.cmd_pending == true)
++				int th_id = omni_thread::self()->id();
++				if (th_id != poll_th_id)
+ 				{
+-					int interupted = mon.wait(DEFAULT_TIMEOUT);
+-					if ((shared_cmd.cmd_pending == true) && (interupted == false))
++					while (shared_cmd.cmd_pending == true)
+ 					{
+-						cout4 << "TIME OUT" << endl;
+-						Except::throw_exception((const char *)"API_CommandTimedOut",
+-					        		(const char *)"Polling thread blocked !!!",
+-					        		(const char *)"DServer::rem_obj_polling");
++						int interupted = mon.wait(DEFAULT_TIMEOUT);
++						if ((shared_cmd.cmd_pending == true) && (interupted == false))
++						{
++							cout4 << "TIME OUT" << endl;
++							Except::throw_exception((const char *)"API_CommandTimedOut",
++										(const char *)"Polling thread blocked !!!",
++										(const char *)"DServer::rem_obj_polling");
++						}
+ 					}
+ 				}
+ 			}
+-		}
+-        else
+-        {
+-            shared_cmd.cmd_pending = true;
+-			if (tmp_upd == 0)
+-				shared_cmd.cmd_code = POLL_REM_EXT_TRIG_OBJ;
+ 			else
+-				shared_cmd.cmd_code = POLL_REM_OBJ;
+-            shared_cmd.dev = dev;
+-            shared_cmd.name = obj_name;
+-            shared_cmd.type = type;
+-
+-            shared_cmd.index = distance(dev->get_poll_obj_list().begin(),ite);
+-
+-            PollThread *poll_th = th_info->poll_th;
+-            poll_th->set_local_cmd(shared_cmd);
+-            poll_th->execute_cmd();
+-        }
+-		cout4 << "Thread cmd normally executed" << endl;
+-	}
+-	else
+-	{
+-		cout4 << "Polling thread is no longer running!!!!" << endl;
++			{
++				shared_cmd.cmd_pending = true;
++				if (tmp_upd == 0)
++					shared_cmd.cmd_code = POLL_REM_EXT_TRIG_OBJ;
++				else
++					shared_cmd.cmd_code = POLL_REM_OBJ;
++				shared_cmd.dev = dev;
++				shared_cmd.name = obj_name;
++				shared_cmd.type = type;
++
++				shared_cmd.index = distance(dev->get_poll_obj_list().begin(),ite);
++
++				PollThread *poll_th = th_info->poll_th;
++				poll_th->set_local_cmd(shared_cmd);
++				poll_th->execute_cmd();
++			}
++			cout4 << "Thread cmd normally executed" << endl;
++		}
++		else
++		{
++			cout4 << "Polling thread is no longer running!!!!" << endl;
++		}
+ 	}
+ 
+ //
+@@ -1604,7 +1609,7 @@ void DServer::rem_obj_polling(const Tango::DevVarStringArray *argin,bool with_db
+ // Kill the thread if needed and join
+ //
+ 
+-		if (kill_thread == true)
++		if (kill_thread == true  && tg->is_svr_shutting_down() == false)
+ 		{
+ 			TangoMonitor &mon = th_info->poll_mon;
+ 			PollThCmd &shared_cmd = th_info->shared_data;
+diff --git a/lib/cpp/server/eventcmds.cpp b/lib/cpp/server/eventcmds.cpp
+index cbf0014..467f42c 100644
+--- a/lib/cpp/server/eventcmds.cpp
++++ b/lib/cpp/server/eventcmds.cpp
+@@ -345,7 +345,9 @@ void DServer::event_subscription(string &dev_name,string &attr_name,string &acti
+ 						{
+ 							if ((attribute.ext->archive_abs_change[0] == INT_MAX) &&
+ 					      		(attribute.ext->archive_abs_change[1] == INT_MAX) &&
+-						   	    (attribute.ext->archive_period        == INT_MAX))
++								(attribute.ext->archive_rel_change[0] == INT_MAX) &&
++								(attribute.ext->archive_rel_change[1] == INT_MAX) &&
++								(attribute.ext->archive_period        == INT_MAX))
+ 							{
+ 								TangoSys_OMemStream o;
+ 								o << "Archive event properties (archive_abs_change or archive_rel_change or archive_period) for attribute ";
+diff --git a/lib/cpp/server/pollobj.h b/lib/cpp/server/pollobj.h
+index 1d504ef..22b684a 100644
+--- a/lib/cpp/server/pollobj.h
++++ b/lib/cpp/server/pollobj.h
+@@ -131,13 +131,13 @@ public:
+ 	void get_attr_history_43(long n,Tango::DevAttrHistoryList_3 *ptr,long type);
+ 
+ protected:
+-	DeviceImpl		*dev;
+-	PollObjType		type;
+-	string 			name;
++	DeviceImpl			*dev;
++	PollObjType			type;
++	string 				name;
+ 	struct timeval		upd;
+ 	struct timeval		needed_time;
+-	double			max_delta_t;
+-	PollRing		ring;
++	double				max_delta_t;
++	PollRing			ring;
+ };
+ 
+ inline bool operator<(const PollObj &,const PollObj &)
diff --git a/debian/patches/series b/debian/patches/series
index 31d0855..e04140d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 0001-debian-fix_database_scripts.patch
 0002-debian-my.cnf.in.patch
 0003-debian-notify_daemon.patch
+0004-upstream-fix-p805_1.patch

-- 
TANGO distributed control system.



More information about the debian-science-commits mailing list