Environment variables

You can use some environment variables to tailor the LIXA configuration to your needs. Some environment variables applies only to one component, others apply to both client and server LIXA components.

LIXA_CLIENT_CONNECTION_TIMEOUT

This environment variable can be used to specify the maximum time a client can wait for an answer from the state server. The value is expressed in milliseconds, -1 is a special value with "no timeout" meaning and 0 is not an acceptable value.

Note

The environment variable and the correlated configuration parameter in the XTA interface has been introduced to prevent process starvation in some specific situations that may happen implementing the Multiple Applications, Concurrent Branches patterns (see the section called “The XTA Programming Model”). There should be no useful usage of this variable outside the two XTA specific patterns.

LIXA_CONFIG_FILE

This environment variable can be used to specify an alternate configuration file for your application. Example: if you are trying a new configuration, but you wont to modify the default etc/lixac_conf.xml file, you can export the variable before program execution:

export LIXA_CONFIG_FILE=/tmp/my_lixac
./myapp
	

myapp will be executed using the configuration stored inside /tmp/my_lixac instead of the configuration stored inside the default etc/lixac_conf.xml client configuration file.

LIXA_CRASH_COUNT

This environment variable must be used only in a development environment: after the program crossed the crash point as many times as the value of this variable (default = 1), the process crashes. See environemt variable LIXA_CRASH_POINT too.

LIXA_CRASH_POINT

This environment variable must be used only in a development environment: it specifies the crash point inside the LIXA code. The acceptable values for this variable are listed inside the C header file src/common/lixa_crash.h LIXA project uses the abort() function to simulate a soft crash.

LIXA_JOB

Warning

This environment variable may be very useful to deal with some specific requirements, but it changes how the automatic recovery process works and the final result could be strange or "unpredictable" if you didn't understand the whole picture.

Use this environment variable to associate a specific transactional job identifier instead of the automatically assigned one. See the section called “Automatic recovery concepts” and the section called “Workload balanced environments” for more information.

LIXA_PROFILE

This environment variable must be used to specify the transactional profile associated to the Application Program. If you do not specify a valid transactional profile, the first profile listed inside etc/lixac_conf.xml will be applied. See the section called “Client configuration explanation” too.

LIXA_STACK_TRACE

This environment variable activate stack tracing for most of the functions in LIXA codebase; it is intended as a problem determination capability; the following values are allowed:

  • ALL to stack trace every function call; this value should not be used in a production environment to avoid a stack trace message congestion

  • ERRORS to stack trace only the function calls that end with an error condition; this is the value suggested to detect anomalous conditions in production environments

  • WARNINGS to stack trace only the function calls that end with either a warning or an error condition; this setting can produce trace messages that are not related to anomalous conditions

LIXA_STATE_ENGINE

This environment variable allows to choose the type of state engine that must be used by the LIXA state server; two values are allowed:

  • TRADITIONAL for the traditional memory mapped based state engine (default value)

  • JOURNAL for the low latency, journal based state engine

LIXA_STATE_SERVERS

This environment variable can be used to override the section <sttsrvs> of the etc/lixac_conf.xml configuration file. It must contain a blank separated lists of URIs encoded as tcp:://address:port/name, where:

  • address is the hostname or the IP address of a LIXA state server

  • port is the port used by the LIXA state server

  • name is the name associated to the LIXA state server and it's referenced by one or more profiles described in the configuration file etc/lixac_conf.xml

A typical usage of the environment variable is the following one:

lixa@4944d8bff50d:/$ lixat
2019-02-09 18:10:18.931258 [8/139695483680640] INFO: LXC000I this process is starting a new LIXA transaction manager (lixa package version is 1.7.4)
tx_open(): -7

lixa@4944d8bff50d:/$ export LIXA_STATE_SERVERS="tcp://192.168.123.35:2345/default"
lixa@4944d8bff50d:/$ lixat
2019-02-09 18:10:59.794849 [9/140591460210560] INFO: LXC000I this process is starting a new LIXA transaction manager (lixa package version is 1.7.4)
tx_open(): 0
tx_close(): 0
	

Instead of changing the content of the etc/lixac_conf.xml configuration file, in some cases, it can be more practical to override the content using the LIXA_STATE_SERVERS environment variable.

LIXA_TRACE_MASK

This environment variable specifies which internal modules must be traced at run-time. The C header file src/common/lixa_trace.h contains the exadecimal value of every internal module; if you want to trace two or more modules you have make the logical OR among all the desired values.

Supposing you are interested in tracing what happens inside "server listener", "server manager" and "server status" modules. Looking at file src/common/lixa_trace.h:

#define LIXA_TRACE_MOD_SERVER_LISTENER    0x00000004
#define LIXA_TRACE_MOD_SERVER_MANAGER     0x00000008
#define LIXA_TRACE_MOD_SERVER_STATUS      0x00000010
	

the resulting value is 0x0000001C:

export LIXA_TRACE_MASK=0x00000010
	

The "trace all" value is 0xffffffff:

export LIXA_TRACE_MASK=0xffffffff
	

Warning

Too much tracing is dangerous: it slows down your system and possibly fills-up your filesystems.

Establishing the internal modules that must be traced is a typical troubleshooting task you can acquire working with LIXA project. In the section called “Tracing” you can discover some useful information related to the usage of this environment variable.