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

Redefined subs from OTOBO::RPC #1121

Closed
bschmalhofer opened this issue Jul 11, 2021 · 2 comments
Closed

Redefined subs from OTOBO::RPC #1121

bschmalhofer opened this issue Jul 11, 2021 · 2 comments
Assignees
Labels
bug Something isn't working as intended
Milestone

Comments

@bschmalhofer
Copy link
Contributor

These warnings show up in the Apache error log when the scripts bin bin/cgi-bin are used:

[Sat Jul 10 21:18:13 2021] otobo.psgi: Subroutine Dispatch redefined at /opt/otobo/bin/cgi-bin/../psgi-bin/otobo.psgi line 95.
[Sat Jul 10 21:18:13 2021] otobo.psgi: Subroutine DispatchMultipleTicketMethods redefined at /opt/otobo/bin/cgi-bin/../psgi-bin/otobo.psgi line 173.
[Sat Jul 10 21:20:15 2021] otobo.psgi: Subroutine new redefined at /opt/otobo/bin/cgi-bin/../psgi-bin/otobo.psgi line 87.

These warnings come from the OTOBO::RPC package in otobo.psgi.

Originally posted by @bschmalhofer in #1054 (comment)

@bschmalhofer bschmalhofer changed the title Redefined subs from OTOBO::RPS Redefined subs from OTOBO::RPC Jul 11, 2021
@bschmalhofer bschmalhofer self-assigned this Jul 11, 2021
@bschmalhofer bschmalhofer added the bug Something isn't working as intended label Jul 11, 2021
@bschmalhofer bschmalhofer added this to the OTOBO 10.1 milestone Jul 11, 2021
@bschmalhofer
Copy link
Contributor Author

Tried to eliminate the package keyword by doing something like *OTOBO::RPC::new = sub {...};. Didn`t help.
...

@bschmalhofer
Copy link
Contributor Author

Moving the implementation of OTOBO::RPC into the file Kernel/System/Web/RPC.pm . This alleviates the redefined sub warnings.
Tested both with Plack::Handler::Apache2 and with Modperl::Registry. Surprisingly, in both cases the file otobo.psgi is reloaded for every request. For the Plack::Handler::Apache2 case this can be improved by preloading otobo.psgi . See https://metacpan.org/pod/Plack::Handler::Apache2#STARTUP-FILE.
Closing this issue, but opening an issue for the preloading.

bschmalhofer added a commit that referenced this issue Jul 19, 2021
Avoid redefined subroutines.
Downside is the package name does not conform to the file name.
bschmalhofer added a commit that referenced this issue Jul 19, 2021
Issue #1121: move OTOBO::RPC into a dedicated .pm file
@bschmalhofer bschmalhofer modified the milestones: OTOBO 10.1, OTOBO 10.1.1 Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended
Projects
None yet
Development

No branches or pull requests

1 participant