Skip to content

Unable to recreate an IAtomicLong object with the same name [AtomicValue[myIAtomicLong] is already destroyed!] #614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
artemiuss opened this issue Mar 11, 2023 · 1 comment

Comments

@artemiuss
Copy link

code:

#!/usr/bin/env python3
import hazelcast

client = hazelcast.HazelcastClient()

my_counter = client.cp_subsystem.get_atomic_long("myIAtomicLong").blocking()
client.cp_subsystem.get_atomic_long("myIAtomicLong").destroy()
my_counter = client.cp_subsystem.get_atomic_long("myIAtomicLong").blocking()
my_counter.set(0)

client.shutdown()

output:

$ ./1.py
Traceback (most recent call last):
  File "/home/ubuntu/1/./1.py", line 9, in <module>
    my_counter.set(0)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/hazelcast/proxy/cp/atomic_long.py", line 322, in set
    return self._wrapped.set(new_value).result()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/hazelcast/future.py", line 63, in result
    re_raise(self._exception, self._traceback)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/hazelcast/util.py", line 469, in re_raise
    raise exception
hazelcast.errors.DistributedObjectDestroyedError: Exception from server: com.hazelcast.spi.exception.DistributedObjectDestroyedException: AtomicValue[myIAtomicLong] is already destroyed!
        at com.hazelcast.cp.internal.datastructures.spi.atomic.RaftAtomicValueService.getAtomicValue(RaftAtomicValueService.java:162)
        at com.hazelcast.cp.internal.datastructures.atomiclong.operation.AbstractAtomicLongOp.getAtomicLong(AbstractAtomicLongOp.java:46)
        at com.hazelcast.cp.internal.datastructures.atomiclong.operation.GetAndSetOp.run(GetAndSetOp.java:45)
        at com.hazelcast.cp.internal.NodeEngineRaftIntegration.runOperation(NodeEngineRaftIntegration.java:219)
        at com.hazelcast.cp.internal.raft.impl.RaftNodeImpl.applyLogEntry(RaftNodeImpl.java:849)
        at com.hazelcast.cp.internal.raft.impl.RaftNodeImpl.applyLogEntries(RaftNodeImpl.java:792)
        at com.hazelcast.cp.internal.raft.impl.RaftNodeImpl.commitEntries(RaftNodeImpl.java:1299)
        at com.hazelcast.cp.internal.raft.impl.RaftNodeImpl.tryAdvanceCommitIndex(RaftNodeImpl.java:1283)
        at com.hazelcast.cp.internal.raft.impl.handler.AppendSuccessResponseHandlerTask.handleResponse(AppendSuccessResponseHandlerTask.java:71)
        at com.hazelcast.cp.internal.raft.impl.handler.AbstractResponseHandlerTask.innerRun(AbstractResponseHandlerTask.java:43)
        at com.hazelcast.cp.internal.raft.impl.task.RaftNodeStatusAwareTask.run(RaftNodeStatusAwareTask.java:52)
        at com.hazelcast.cp.internal.NodeEngineRaftIntegration.execute(NodeEngineRaftIntegration.java:114)
        at com.hazelcast.cp.internal.raft.impl.RaftNodeImpl.execute(RaftNodeImpl.java:883)
        at com.hazelcast.cp.internal.raft.impl.RaftNodeImpl.handleAppendResponse(RaftNodeImpl.java:403)
        at com.hazelcast.cp.internal.RaftService.handleAppendResponse(RaftService.java:718)
        at com.hazelcast.cp.internal.operation.integration.AppendSuccessResponseOp.run(AppendSuccessResponseOp.java:48)
        at com.hazelcast.spi.impl.operationservice.Operation.call(Operation.java:192)
        at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.call(OperationRunnerImpl.java:295)
        at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.run(OperationRunnerImpl.java:270)
        at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.run(OperationRunnerImpl.java:498)
        at com.hazelcast.spi.impl.operationexecutor.impl.OperationThread.process(OperationThread.java:197)
        at com.hazelcast.spi.impl.operationexecutor.impl.OperationThread.process(OperationThread.java:137)
        at com.hazelcast.spi.impl.operationexecutor.impl.OperationThread.executeRun(OperationThread.java:123)
        at com.hazelcast.internal.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:102)
@artemiuss artemiuss changed the title Unable to recreate an IAtomicLong object with the same name Unable to recreate an IAtomicLong object with the same name [AtomicValue[myIAtomicLong] is already destroyed!] Mar 11, 2023
@artemiuss
Copy link
Author

Not a bug:
“If you call the DistributedObject.destroy() method on a CP data structure proxy, that data structure is terminated on the underlying CP group and cannot be reinitialized until the CP group is force-destroyed via CPSubsystemManagementService.forceDestroyCPGroup(String). For this reason, please make sure that you are completely done with a CP data structure before destroying its proxy.”
https://docs.hazelcast.com/imdg/4.2/cp-subsystem/cp-subsystem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants