Skip to content

Commit

Permalink
Merge pull request #175 from babsingh/isRunningInContainer_040
Browse files Browse the repository at this point in the history
[0.40] Ignore errors, delay and cache the result of isRunningInContainer
  • Loading branch information
pshipton authored Jun 15, 2023
2 parents 685c530 + e5f9a0e commit 4cc70bc
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 156 deletions.
3 changes: 3 additions & 0 deletions nls/portnls.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,8 @@
#define J9NLS_PORT_LINUXDUMP_PIPE_CORE_NOT_FOUND__MODULE 0x504f5254
#define J9NLS_PORT_LINUXDUMP_PIPE_CORE_NOT_FOUND__ID 49
#define J9NLS_PORT_LINUXDUMP_PIPE_CORE_NOT_FOUND J9NLS_PORT_LINUXDUMP_PIPE_CORE_NOT_FOUND__MODULE, J9NLS_PORT_LINUXDUMP_PIPE_CORE_NOT_FOUND__ID
#define J9NLS_PORT_RUNNING_IN_CONTAINER_FAILURE__MODULE 0x504f5254
#define J9NLS_PORT_RUNNING_IN_CONTAINER_FAILURE__ID 50
#define J9NLS_PORT_RUNNING_IN_CONTAINER_FAILURE J9NLS_PORT_RUNNING_IN_CONTAINER_FAILURE__MODULE, J9NLS_PORT_RUNNING_IN_CONTAINER_FAILURE__ID

#endif
3 changes: 1 addition & 2 deletions port/common/omrsysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ omrsysinfo_shutdown(struct OMRPortLibrary *portLibrary)
int32_t
omrsysinfo_startup(struct OMRPortLibrary *portLibrary)
{
PPG_isRunningInContainer = FALSE;
return 0;
}

Expand Down Expand Up @@ -1095,7 +1094,7 @@ omrsysinfo_get_cgroup_subsystem_list(struct OMRPortLibrary *portLibrary)
BOOLEAN
omrsysinfo_is_running_in_container(struct OMRPortLibrary *portLibrary)
{
return PPG_isRunningInContainer;
return FALSE;
}

/**
Expand Down
2 changes: 0 additions & 2 deletions port/include/omrportpg.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ typedef struct OMRPortPlatformGlobals {
uintptr_t vmem_pageSize[OMRPORT_VMEM_PAGESIZE_COUNT]; /** <0 terminated array of supported page sizes */
uintptr_t vmem_pageFlags[OMRPORT_VMEM_PAGESIZE_COUNT]; /** <0 terminated array of flags describing type of the supported page sizes */
uintptr_t systemLoggingFlags;
BOOLEAN isRunningInContainer;
} OMRPortPlatformGlobals;

#define PPG_vmem_pageSize (portLibrary->portGlobals->platformGlobals.vmem_pageSize)
#define PPG_vmem_pageFlags (portLibrary->portGlobals->platformGlobals.vmem_pageFlags)
#define PPG_syslog_flags (portLibrary->portGlobals->platformGlobals.systemLoggingFlags)
#define PPG_isRunningInContainer (portLibrary->portGlobals->platformGlobals.isRunningInContainer)
#endif /* omrportpg_h */
Loading

0 comments on commit 4cc70bc

Please sign in to comment.