Skip to content
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

ISSUE-5334 Disconnection: the distributed way #1473

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vttranlina
Copy link
Member

@vttranlina vttranlina commented Jan 16, 2025

resolve linagora/james-project#5334

Require

Todo

  • Add more test cases
  • Clean up pom dependencies
  • Verify the case the disconnection are executed multi time

Copy link
Member

@chibenwa chibenwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks overall good!

@vttranlina vttranlina changed the title WIP - ISSUE-5334 Disconnection: the distributed way ISSUE-5334 Disconnection: the distributed way Jan 17, 2025
@vttranlina vttranlina marked this pull request as ready for review January 17, 2025 07:58
@vttranlina vttranlina self-assigned this Jan 17, 2025
Copy link
Member

@chibenwa chibenwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a small test suite with 2 distributed disconnectors>

IE

GIVEN bob connected on A
WHEN I ask B to disconnect bob
THEN bob is well disconnected

GIVEN bob connected on A and B
WHEN I ask B to disconnect bob
THEN bob is well disconnected on both...

@vttranlina
Copy link
Member Author

Can we have a small test suite with 2 distributed disconnectors>

I can't start 2 GuiceJamesServer instances at same time, it throw exception

16:44:57.356 [ERROR] o.a.j.GuiceJamesServer - Fatal error while starting James
javax.management.InstanceAlreadyExistsException: org.apache.james:type=component,component=mailetcontainer,name=processor,processor=local-delivery,subtype=mailet,index=0,mailetname=VacationMailet

@vttranlina
Copy link
Member Author

I think the test case DistributedProtocolServerIntegrationTest#shouldPublishFanoutMessageWhenDisconnectRouteIsCalled and RabbitMQDisconnectorConsumerTest unit test is partially fulfill this requirement.

@vttranlina
Copy link
Member Author

Regarding the "javax.management.InstanceAlreadyExistsException" error #1473 (comment)

We cannot disable javax.management.MBeanServer as it is used in several modules (mailetcontainer-impl, protocols-smtp, protocols-library, imap, etc.).
I tried to find a way to create a new JVM for the GuiceJamesServer, but it seems quite complicated for testing. (java.lang.ProcessBuilder)

An alternative is to use tmail docker for testing (similar to the deployment-test module), but I think it is not suitable for the deployment module.
WDYT?

@chibenwa
Copy link
Member

An alternative is to write unit tests only for the component you need.

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

Successfully merging this pull request may close these issues.

[MU] Disconnection: the distributed way
3 participants