Issue Details (XML | Word | Printable)

Key: CORE-2418
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Van den Wouwer Danny
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Multiple named instances on same Windows server seems to produce errors

Created: 11/Apr/09 03:43 AM   Updated: 11/Apr/09 04:04 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Environment:
Windows XP SP3
FB 2.1.1
FB 2.1.2
FB 2.5.0


 Description  « Hide
I have on a Windows XP SP3 3 installations:

All installed for classic server:

* FB 2.1.1 Instance name: 211
* FB 2.1.2 Instance name: 212
and
FB 2.5.0 B1 Instance name: 250B1

Steps:
1. Start instance 211, firebird.log stays empty, all ok
2. Start instance 212, logs says:

DANNY Sat Apr 11 12:24:04 2009
XNET error: Server initialization failed


DANNY Sat Apr 11 12:24:04 2009
Database:

3. Start the third instance 250, logs says:

DANNY Sat Apr 11 12:24:53 2009
Database: XNET error: XNET server initialization failed
operating system directive CreateMutex failed
Cannot create a file when that file already exists.


DANNY Sat Apr 11 12:24:53 2009
operating system directive CreateMutex failed
Cannot create a file when that file already exists.

Second test:
1. Start instance 212, firebird.log stays empty, all ok
2. Start instance 211, logs says:

DANNY Sat Apr 11 12:26:39 2009
XNET error: Server initialization failed


DANNY Sat Apr 11 12:26:39 2009
Database:

3. Start 250, logs says:

DANNY Sat Apr 11 12:26:52 2009
Database: XNET error: XNET server initialization failed
operating system directive CreateMutex failed
Cannot create a file when that file already exists.


DANNY Sat Apr 11 12:26:52 2009
operating system directive CreateMutex failed
Cannot create a file when that file already exists.

Because of better info in logs for 250B1, i started to see on the created mutexes of each process using Process Explorer:
If you only start 211 I got following objects:
\BaseNamedObjects\firebird_trace_mutex
\BaseNamedObjects\FirebirdServerMutexFB211
\BaseNamedObjects\FIREBIRD_CONNECT_MUTEX
\BaseNamedObjects\FIREBIRD_CONNECT_MAP (Section, memory mapped file, probably guarded by mutex: \BaseNamedObjects\FIREBIRD_CONNECT_MUTEX?)

If you only start 212 I got following objects:
\BaseNamedObjects\firebird_trace_mutex
\BaseNamedObjects\FirebirdServerMutexFB212
\BaseNamedObjects\FIREBIRD_CONNECT_MUTEX
\BaseNamedObjects\FIREBIRD_CONNECT_MAP

If you only start 250 I got following objects:
\BaseNamedObjects\firebird_trace_mutex
\BaseNamedObjects\FirebirdServerMutexFB250
\BaseNamedObjects\FIREBIRD_CONNECT_MUTEX
\BaseNamedObjects\FIREBIRD_CONNECT_MAP

If I start first 211, then 212, 250 I got:
\BaseNamedObjects\firebird_trace_mutex
\BaseNamedObjects\FirebirdServerMutexFB211
\BaseNamedObjects\FIREBIRD_CONNECT_MUTEX
\BaseNamedObjects\FIREBIRD_CONNECT_MAP

If you only start 212 I got following objects:
\BaseNamedObjects\firebird_trace_mutex
\BaseNamedObjects\FirebirdServerMutexFB212

If you only start 250 I got following objects:
\BaseNamedObjects\firebird_trace_mutex
\BaseNamedObjects\FirebirdServerMutexFB250

Conclusion:
* First of all, It seems clear to me now why I got these errors. Because the first instance you start create's a mutex and a section to handle local connections through the help of a memory mapped file.
Because it seems that only one firebird server can handle local connections, it seems logically that the second and third cannot create the same mutex and section for local connections.

* But it was very confusing to see such errors in the log.

=> Maybe it is better to say in logs that another instance (here it is instance 211) that owns the right for local connections (aka Mutex and section) instead of the rather cryptic errors (in 25B1 it is already improved).

Or is this not intended this way?

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Gabor Boros added a comment - 11/Apr/09 04:02 AM - edited
You have different config for all instances? If you want to use multiple instances modify RemoteServicePort, IpcName, RemotePipeName, CreateInternalWindow parameters on firebird.conf for all instances and don't use registry (instreg) and FIREBIRD environment variable.