Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#1900 closed defect (duplicate)

Raw data importer fails: A handler with ID '1728751927' is already registered

Reported by: Nicklas Nordborg Owned by: everyone
Priority: minor Milestone: BASE 3.4
Component: coreplugins Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

There have been a couple of cases on the production server when the raw data importer fails with:

net.sf.basedb.core.signal.SignalException: 
A handler with ID '1728751927' is already registered: 
net.sf.basedb.core.signal.DelegatingSignalHandler@670aa937
 at net.sf.basedb.core.signal.AbstractSignalReceiver.registerSignalHandler(AbstractSignalReceiver.java:173)
 at net.sf.basedb.core.PluginExecutionRequest.invoke(PluginExecutionRequest.java:109)
 at net.sf.basedb.core.InternalJobQueue$JobRunner.run(InternalJobQueue.java:571)
 at java.lang.Thread.run(Thread.java:745)

Restarting the import usually resolves the problem.

Change History (4)

comment:1 by Nicklas Nordborg, 10 years ago

Description: modified (diff)

comment:2 by Nicklas Nordborg, 10 years ago

Investigating the code this seems like a strange error at first. The code in PluginExecutionRequest is creating a new instance of DelegatingSignalHandler each time it is called, so the only possible cause is that there is already another instance with the same ID. The ID is calculated based on the System.identityHashCode(). Typically the hash code has been calculated by the JRE based on the memory location of the object instance and the assumption has been that it is a unique value.

However, a quick search on the internet, this seems like a false assumption that may have been valid only a long time ago. In the current JRE there is no such guarantee.

So, we really need to use something else as the ID and it must be something that is unique and can be derived from a given object instance.

comment:3 by Nicklas Nordborg, 10 years ago

Resolution: duplicate
Status: newclosed

Will be fixed as part of #1901.

comment:4 by Nicklas Nordborg, 10 years ago

(In [6665]) References #1900 and #1901.

This should hopefully fix the ID issue for the job queue.

Note: See TracTickets for help on using tickets.